refine icon indicating copy to clipboard operation
refine copied to clipboard

feat(mui): propagate DataGrid quickFilter values via meta in useDataGrid

Open jwgmeligmeyling opened this issue 6 months ago • 2 comments

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

jwgmeligmeyling avatar May 17 '26 11:05 jwgmeligmeyling

🦋 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

changeset-bot[bot] avatar May 17 '26 11:05 changeset-bot[bot]

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

jsingh6 avatar Jun 18 '26 15:06 jsingh6