Skip to main content

move()

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

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.
oldPathPathOriginal 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.

Defined in

packages/react-querybuilder/src/utils/queryTools.ts:310


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.