MRT Columns not showing in toggle hidding #864
-
|
Hello everyone, I'm reaching out for some assistance with Material React Table (MRT) in a React/MobX environment. I've been struggling with an issue for several days and haven't found a solution. The Problem: Simplified Code for Context: And the columns are defined as: const columns = useMemo( The data is defined as: const data = useMemo(() => answersStore.data || [], [answersStore.data]); In the MobX store, headers are transformed to columns like this: transformHeadersToColumns(headers) { }); const response = await collectFormAnswersData(this.url_code); The Issue: Has anyone faced a similar issue or could provide some insight into what might be going wrong? Any help or guidance would be greatly appreciated. Thank you in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
You can refer to this example ttps://www.material-react-table.com/docs/examples/dynamic-columns. Alternatively, consider implementing a straightforward approach: check if the data length is greater than 0 before rendering the grid. This ensures that the grid is only rendered when there is substantial data to display. |
Beta Was this translation helpful? Give feedback.
You can refer to this example ttps://www.material-react-table.com/docs/examples/dynamic-columns.
Alternatively, consider implementing a straightforward approach: check if the data length is greater than 0 before rendering the grid. This ensures that the grid is only rendered when there is substantial data to display.