fix(query-builder): refactor the components#1087
Conversation
There was a problem hiding this comment.
Pull request overview
Refactors the Query Builder interaction samples from class-based React components to functional components using hooks, while keeping the existing Ignite UI Query Builder setup and behavior.
Changes:
- Converted the
Samplecomponents to functional components withuseRefanduseEffectlifecycle equivalents. - Moved static configuration (entities/fields/options and template builders) out of component instances into module-level constants/functions.
- Rewired
expressionTreeChangehandling and initial setup/teardown to use effect cleanup.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| samples/interactions/query-builder/template/src/index.tsx | Converts the template sample to hooks, extracts field/options/template helpers, and sets up Query Builder event handling via useEffect. |
| samples/interactions/query-builder/overview/src/index.tsx | Converts the overview + grid sample to hooks, extracts entities/fields, and fetches data on expressionTreeChange with effect-based setup/cleanup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
IMinchev64
left a comment
There was a problem hiding this comment.
Hmm, weird. I still notice strange behavior with the default input field. I thought changing the input event to the correct onInput would resolve it but I was wrong.
See attached video of the behavior:
query-builder-react.mp4
IMinchev64
left a comment
There was a problem hiding this comment.
It seems that similar to IgrInput in buildDefaultInput the following components also use sender.vlaue which is undefined and needs to be changed to sender.detail:
IgrSelectIgrDatePickerIgrDateTimeInput
…thub.com/IgniteUI/igniteui-react-examples into hhristov/fix-query-builder-react-samples
Refactor the query builder samples to use functional components