KevinVandy / material-react-table

A fully featured Material UI V5 implementation of TanStack React Table V8, written from the ground up in TypeScript
https://material-react-table.com
MIT License
1.5k stars 433 forks source link

When the options for filterSelectOptions are variables the component don't rerender #1175

Open nfuenmamelt opened 3 months ago

nfuenmamelt commented 3 months ago

material-react-table version

2.0.0

react & react-dom versions

18.2.0

Describe the bug and the steps to reproduce it

We have a custom filterselectoption for one column. but that filter depends on the values for that same columns.

For example:

We create a new tag, and all tags will be available to filter in that column.

Screenshot from 2024-07-03 09-47-41

On that image you can see we added a new tag but on filter options don't appear.

I believe it could be related to a memoized component of the multi-select filter.

Minimal, Reproducible Example - (Optional, but Recommended)

filterSelectOptions: devicesGroups.map((item) => ({ text: item.name, value: item.name, })),

Screenshots or Videos (Optional)

Screencast from 03-07-24 09:50:00.webm

Do you intend to try to help solve this bug with your own PR?

No, because I do not know how

Terms

KevinVandy commented 2 months ago

share more code, or even a full sandbox repro. Might just be that your columnDefs did not have the proper dependency array in the useMemo. But impossible to tell if you don't show it.