[data grid] useGridApiRef
returns RefObject
, but DataGrid apiRef
prop only accepts MutableRefObject
#16194
Labels
bug 🐛
Something doesn't work
component: data grid
This is the name of the generic UI component, not the React module!
duplicate
This issue or pull request already exists
Steps to reproduce
@mui/x-data-grid-pro v7.23.6
and TypeScript:Current behavior
Currently, we get an error of the style
when trying to pass an
apiRef
fromuseGridApiRef()
to theDataGrid
component.This issue is likely related to #16135, but more specifically causes us to not be able to use the api at all without an ugly cast like
Or am I missing something? I couldn't find any documentation on how to register the
apiRef
if not like this.Expected behavior
useGridApiRef()
returning aMutableRef
Context
Our support key is
65425
.We use the apiRef for all sorts of stuff, including
exportState()
,setRowChildrenExpansion
and others.Your environment
npx @mui/envinfo
Search keywords: MutableRefObject apiRef GridApi
The text was updated successfully, but these errors were encountered: