Skip to main content

move()

move<RG>(query: RG, oldPathOrID: string | Path, newPath: Path | "up" | "down", __namedParameters: MoveOptions): RG

Defined in: packages/react-querybuilder/src/utils/queryTools.ts:343

Moves a rule or group from one path to another. In the options parameter, pass { clone: true } to copy instead of move.

Type Parameters

Type Parameter
RG extends RuleGroupTypeAny

Parameters

ParameterTypeDescription
queryRGThe query to update.
oldPathOrIDstring | PathID or original path of the rule or group to move.
newPathPath | "up" | "down"Path to move the rule or group to, or a shift direction.
__namedParametersMoveOptionsOptions.

Returns

RG

The new query with the rule or group moved or cloned.


caution

API documentation is generated from the latest commit on the main branch. It may be somewhat inconsistent with official releases of React Query Builder.