[DataGrid] Export useGridApiRef
and useGridApiContext
in the community package
#6147
Closed
6 tasks done
Labels
component: data grid
This is the name of the generic UI component, not the React module!
new feature
New feature or request
v6.x
Summary
The Data Grid's API Object, commonly called
apiRef
, is a powerful feature that enables advanced control of the grid programmatically.It's currently exported in the Pro and Premium packages, but we want to open the feature to the whole community.
Related RFC: #3166
Motivation
TODO
Create list of
apiRef
properties and their availability depending on the plan: https://www.notion.so/mui-org/363d01703ac04e8e96d991937cb4f7da?v=18fbbc8349b84fbeaf6818d096f0d1daExtract private (internal) properties out of public
apiRef
and stop exposing them to users - Flavien did a POC for it last year POC: Support private methods on apiRef flaviendelangle/mui-x#11[DataGrid] Separate private and public
apiRef
properties #6388Add
apiRef
prop toDataGrid
and exportuseGridApiRef
in community packageMake some properties private depending on the plan
Take
selectRows
method for example.It's defined in community package
mui-x/packages/grid/x-data-grid/src/hooks/features/selection/useGridSelection.ts
Line 205 in 4eab92f
and it's used in community package as well:
mui-x/packages/grid/x-data-grid/src/hooks/features/selection/useGridSelection.ts
Line 469 in 4eab92f
But since multiple row selection is not available in Community plan, it doesn't make any sense to expose this method in community
apiRef
.To solve this, we can make this method private in Community plan and public in Pro and Premium plans.
Update the docs
apiRef
is marked as Pro feature in places like https://mui.com/x/react-data-grid/pagination/#apiref or https://mui.com/x/react-data-grid/pagination/#selectorsAdd release notes with a list of removed private methods
The text was updated successfully, but these errors were encountered: