[system][createStyled] Intercept ownerState coming from props and ownerState#42358
Merged
DiegoAndai merged 3 commits intomui:nextfrom May 28, 2024
Merged
Conversation
ownerState coming from props and ownerState
Netlify deploy previewhttps://deploy-preview-42358--material-ui.netlify.app/ Bundle size reportDetails of bundle changes (Toolpad) |
Member
Author
|
See Argos changes for the fixes |
This was referenced May 23, 2024
1 task
mnajdova
reviewed
May 27, 2024
Member
mnajdova
left a comment
There was a problem hiding this comment.
There are few more lines where we handle this, e.g.
andCan we create a const at the top of the function and used that in all places?
Member
Author
|
@mnajdova I refactored by creating a const and added a test. For the occurrences you point out, there's no risk of overriding. The function signature is function processStyleArg(callableStyle, { ownerState, ...props })So |
mnajdova
approved these changes
May 27, 2024
Member
mnajdova
left a comment
There was a problem hiding this comment.
Test, logic and argos look good to me 👌 We should port this logic to Pigment CSS too.
This was referenced May 28, 2024
joserodolfofreitas
pushed a commit
to joserodolfofreitas/material-ui
that referenced
this pull request
Jul 29, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From #42345 (comment)
This resolves the styled symptoms of #42184 by not allowing
ownerStatevalues coming frompropsorownerStateto override the component'sownerState.It does not close #42184, as nested
ownerStatevalues are still being propagated.