-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[DataGrid] Enable the documentation of the portable state #4028
[DataGrid] Enable the documentation of the portable state #4028
Conversation
These are the results for the performance tests:
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
{...data} | ||
loading={loading} | ||
initialState={savedState.initialState} | ||
key={savedState.count} |
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.
Better to use a real prop.
key={savedState.count} | |
className={`grid-${savedState.count}`} |
Side note: we should support the id
prop.
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.
It is the initialState
so we need to remount the grid whenever the state changes.
Just causing a re-render won't re-apply the initial state.
That's why I was unmounting / remounting the main grid before.
|
||
### Restore the state with `apiRef` [<span class="plan-pro"></span>](https://mui.com/store/items/material-ui-pro/) | ||
|
||
{{"demo": "RestoreStateApiRef.js", "bg": "inline", "defaultCodeOpen": false}} |
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.
We miss a paragraph explaining how to interact with the demo.
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.
Done
{({ TransitionProps }) => ( | ||
<Fade {...TransitionProps} timeout={350}> | ||
<Paper> | ||
<List> |
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.
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.
I migrated to a MenuList
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.
There're still some things to fix but you can merge it as soon as you're OK with it.
Preview: https://deploy-preview-4028--material-ui-x.netlify.app/components/data-grid/state/#save-and-restore-the-state
Closes #820