Why are columns memoized? #844
Unanswered
claresloggett
asked this question in
Q&A
Replies: 1 comment
-
Just make sure your dependency array is correct and you won't have the bug probably. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Can anyone explain to me why the columns passed in to the MaterialReactTable columns property would be memoized? For instance, in this example sandbox https://codesandbox.io/p/devbox/material-react-table-example-advanced-93wiof the columns are set to useMemo<MRT_ColumnDef[]>() of the actual array of columns.
I ask because we've encountered a bug in the column hiding behaviour when setting columns & data dynamically and when enableRowSelection is enabled. Before putting in a bug report, I thought I'd try to create a reproducible sandbox, and noticed that in this existing sandbox, the columns are memoized - I'd like to make sure I am not doing something wrong before I submit a bug report.
If I remove the memoization in the sandbox, everything still seems to work, although maybe I'm missing something.
Thanks for any help!
Beta Was this translation helpful? Give feedback.
All reactions