Skip to main content

ungroup

const ungroup: UngroupMethod

Defined in: packages/core/src/utils/queryTools.ts:757

Replaces a group with its own rules in its parent group, without mutating the original query.

The group's combinator, not, id, muted, and disabled properties are discarded; its rules keep their ids since they remain in the same query. An empty group is simply removed.

Returns​

A new query with the group's rules promoted into its parent group.


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.