Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Add warning clarifications #5399

Merged
merged 3 commits into from
Jul 25, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions docs/data/data-grid/row-grouping/row-grouping.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,18 @@ return (
```

:::warning
This hook is only compatible with the deprecated column property `hide` or with the controlled `columnVisibilityModel` prop.
This hook is not compatible with the deprecated column property `hide`.
It can be used with controlled `columnVisibilityModel` and `initialState`.
To do so, provide the controlled value and the initial state to the hook as follow:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You just have to provide one of the two, and the example below is redundant with what is currently existing


```jsx
const initialState = useKeepGroupedColumnsHidden({
apiRef,
rowGroupingModel,
initialState,
});
```

You must use the `columnVisibilityModel` in the `initialState` instead.
:::

{{"demo": "RowGroupingUseKeepGroupedColumnsHidden.js", "bg": "inline", "defaultCodeOpen": false}}
Expand Down