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

[system] Merge props and ownerState in the variants props callback #41219

Merged

Conversation

mnajdova
Copy link
Member

@mnajdova mnajdova commented Feb 21, 2024

Fixes #41220

Consolidate the arguments for the variants' props callback between the @mui/system and the zero-runtime. The argument is now merging props and ownerState, so that developers can do:

variants: [{
  props: (props) => props.someState === 'some-value'
}]

instead of needing to do:

variants: [{
  props: (props) => props.ownerState.someState === 'some-value'
}]

Zero-runtime related code: https://github.com/mui/material-ui/blob/master/packages/zero-runtime/src/styled.jsx#L9

@mnajdova mnajdova added the package: system Specific to @mui/system label Feb 21, 2024
@mui-bot
Copy link

mui-bot commented Feb 21, 2024

Netlify deploy preview

https://deploy-preview-41219--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 2adb748

Copy link
Contributor

@brijeshb42 brijeshb42 left a comment

Choose a reason for hiding this comment

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

Thanks

@mnajdova mnajdova marked this pull request as ready for review February 21, 2024 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: system Specific to @mui/system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[system][zero] Consolidate the arguments in the variant's props callback
3 participants