React Query Builder is a highly customizable React component designed for constructing complex queries and filters dynamically. It currently maintains a stable version of 8.15.0, with a release cadence that includes frequent patch releases for bug fixes and security updates, alongside regular minor version updates introducing new features and compatibility improvements. Key differentiators include its extensive customization options, first-class support for integration with popular UI libraries like Ant Design, Bootstrap, Chakra UI, and Fluent UI via dedicated compatibility packages, and a comprehensive suite of utility functions for importing and exporting queries to various formats, including SQL, MongoDB, and JSON. The library focuses on providing a flexible and robust solution for building rule-based query interfaces in React applications.
npm install react-querybuilderVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to set up a basic QueryBuilder component with predefined fields, an initial query, and state management using React hooks. It also shows the generated query structure.
Use `import { createReactDnDAdapter } from '@react-querybuilder/dnd';` and pass `dnd={createReactDnDAdapter()}` to the QueryBuilder component.Migrate to `createReactDnDAdapter` for drag-and-drop integration.
Install `react-dnd` and `react-dnd-html5-backend` if using drag-and-drop features: `npm install react-dnd react-dnd-html5-backend`.
Applications consuming MongoDB queries generated by previous versions should update their logic to handle `$nor` for negated rule groups instead of `$not`.
No direct fix needed unless custom transformations were explicitly designed to exploit prototype pollution (highly unlikely and discouraged).
Upgrade `react-querybuilder` to version 8.14.4 or higher. The library now correctly uses `$nor` for rule group negation in MongoDB export formats.
Ensure `react-dnd` and its necessary backend (e.g., `react-dnd-html5-backend`) are installed as `react-dnd` became an optional peer dependency in `v8.15.0` for `@react-querybuilder/dnd`.
Use the `createReactDnDAdapter` function from `@react-querybuilder/dnd` to properly wrap `react-dnd` exports. Example: `dnd={createReactDnDAdapter()}`.