'React Material Table complains about non-stable functions in columns
I use material table component and use specific render options for a few columns. In one of the columns I use for instance the React-Mui component Checkbox.
...
{
title: "Actief",
field: "enabled",
render: (rowData) => {
return (
<Checkbox
checked={rowData.enabled}
onChange={(e) => ToggleActive(rowData) }
inputProps={{ 'aria-label': 'controlled' }}
disabled={(rowData.username === "test_admin" || rowData.username === "test_volunteer")}
/>);
}
},
...
Now I see a warning in the console:
The columns provided to material table are static, but contain functions which update on every render, resetting the table state. Provide a stable function or column reference or an row id to prevent state loss.
However I cannot find anything about how to solve this.
Do I miss some option or what?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
