When I add the following code snippet to my react component:
const apiRef = useGridApiRef();
const initialState = useKeepGroupedColumnsHidden({
apiRef,
initialState: {
rowGrouping: {
model: ['datetime'],
},
},
});
it gives the error props.apiRef.current.subscribeEvent is not a function
This github discussion says to fix the issue is to use DataGrid Pro/Premium, but am indeed importing the objects from the premium import:
import {
useKeepGroupedColumnsHidden,
useGridApiRef,
} from '@mui/x-data-grid-premium';
codesandbox: https://codesandbox.io/s/festive-satoshi-fmszwu?file=/demo.tsx