feat(mui): propagate DataGrid quickFilter values via meta in useDataGrid
PR Checklist
Please check if your PR fulfills the following requirements:
- [x] The commit message follows our guidelines: https://refine.dev/docs/guides-concepts/contributing/#commit-convention
Bugs / Features
- [ ] Related issue(s) linked
- [x] Tests for the changes have been added
- [x] Docs have been added / updated
- [x] Changesets have been added https://refine.dev/docs/guides-concepts/contributing/#creating-a-changeset
What is the current behavior?
Quick filters from the MUI filter state not propagated to the data provider
What is the new behavior?
Quick filters from the MUI filter state propagated to the data provider
Notes for reviewers
🦋 Changeset detected
Latest commit: 1f55d781baf9c92078723c8b7063816370ae1070
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| @refinedev/mui | Minor |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Preflight flagged 1 potential issue worth a look:
packages/mui/src/hooks/useDataGrid/index.ts · preflight/typescript/useeffect-missing-deps · HIGH
Wondering if there could be an issue with [muiCrudFilters, preferredPermanentFilters, columnsTypes.cur… here?
columnsTypes.current is a ref's .current property used in a useMemo dependency array. Refs are mutable objects whose .current value can change without React notifying the component, so columnsTypes.current captured at memo-creation time may become stale. Putting columnsTypes.current in the deps array doesn't reliably track mutations to the ref — the same issue as a missing/stale dep in useEffect.
Suggestion: could this be restructured to avoid the problem described above?
[muiCrudFilters, preferredPermanentFilters, columnsTypes.current],
Posted by Preflight