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
Parameter | Type | Description |
---|---|---|
query | RG | The query to update. |
oldPath | Path | Original path of the rule or group to move. |
newPath | Path | "up" | "down" | Path to move the rule or group to, or a shift direction. |
__namedParameters | MoveOptions | Options. |
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.