I have a fairly simple datagrid table with the option to hide/show specific columns. I want to save the state of the columns when a rerender occurs (in my case when the language is changed).
Here is a stripped down sample. Just hide a column and then click the button. The column-header change as expected but the hidden column reappears.
https://codesandbox.io/s/material-demo-forked-lq22m
I think I have to set the hide property correctly to the current state of the columns in my click handler:
const handleButtonClick = () => {
setColumnState((c) => c.map((d) => ({ ...d, hide:currentStateofHideForEachCol, headerName: "nombre" })));
};
But I cant find a way to access it.