Skip to main content

add()

add<RG>(query, ruleOrGroup, parentPath, __namedParameters): RG

Adds a rule or group to a query.

Type Parameters

Type Parameter
RG extends RuleGroupTypeAny

Parameters

ParameterTypeDescription
queryRGThe query to update.
ruleOrGroupRuleType<string, string, any, string> | RGThe rule or group to add.
parentPathPathPath of the group to add to.
__namedParametersAddOptionsOptions.

Returns

RG

The new query with the rule or group added.

Defined in

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


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.