Skip to main content

moveRE()

moveRE<RE>(rulesEngine: RE, oldConditionPathOrID: string | Path, newConditionPathOrIdOrShiftDir: Path | string & { } | "up" | "down", __namedParameters: MoveOptionsRE): RE

Defined in: packages/rules-engine/src/utils/rulesEngineTools.ts:192

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

Type Parameters

Type Parameter
RE extends RulesEngineAny

Parameters

ParameterTypeDescription
rulesEngineREThe rules engine to update.
oldConditionPathOrIDstring | PathPath or ID of the condition to move, or the condition itself if moving within a nested group.
newConditionPathOrIdOrShiftDirPath | string & { } | "up" | "down"Path to move the condition to, ID of the condition to replace/insert before, or shift direction.
__namedParametersMoveOptionsREOptions.

Returns

RE

The new rules engine with the condition 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.