-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Conversation
These are the results for the performance tests:
|
@@ -142,9 +142,9 @@ 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`, and you should not control the `columnVisibilityModel`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow my sentence made no sense...
It should be compatible with the controlled columnVisibilityModel
prop if you also pass its value to the hook.
See the RowGroupingCustomGroupingColDefCallback
example
This hook is not compatible with the deprecated column property `hide`, and you should not control the `columnVisibilityModel`. | ||
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: |
There was a problem hiding this comment.
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
::: | ||
|
||
Bellow are two examples about how to use `columnVisibilityModel`, or `initialState` with `useKeepGroupedColumnsHidden` hook. | ||
You can mix the two examples to support both at the same time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In which scenario would you use both an initial state and a control state ? The control state would totally override the initial state right ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it was in the second example O:)
If I want to use initialState
to initialize the filterModel
and I don't want to bother myself with mixing it with the initialState
generated by the hook
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ok, I thought you were talking about setting the same model in both control and initial mode
* [docs] Add warning clarifications * fix * try to clarify examples
I struggled to understand a warning in row grouping documentation about
useKeepGroupedColumnsHidden
Not sure my correction is exactly what the hook does