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] Fix missing dependency in the DataGrid demo #27597
Conversation
Direct dependency or peer dependency? |
@eps1lon It's a transitive dependency. |
It should either be a direct dependency or peer dependency. It sounds like When you say "transitive" then what package depends on it that you depend on? If you depend on a package that has a peer dependency on /styles then you need to either declare it as a |
That's something we need to fix to support v5.
The
Yeah, we gonna need to add I changed this PR to not relay on the import-hack but to add |
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 suspect that for the next branch in the core repository, it won't be relevant long as we will likely drop core v4 support or simply degrade its support by depending on @mui/core-material v5 to use styled() with a peer dependence on emotion.
I think that it would help to cherry-pick this on master.
You can't satisfy a dependency on B by declaring a dependency on A that depends on B. That was never supported and mostly worked incidentally. |
Fixes #27629
The DataGrid component depends on @material-ui/styles. In v4, this package is a dependency of @material-ui/core. However, in v5 it became optional. When the demo is opened in CodeSandbox, it collects all imports and adds the equivalent dependencies to the package.json. Since @material-ui/styles was not being imported it was not added, so it crashes.
Preview: https://deploy-preview-27597--material-ui.netlify.app/components/tables/#data-table
Open the demo in CodeSandbox