Skip to content

Conversation

@DiegoAndai
Copy link
Member

Follow up on mui/material-ui#42358 (review)

Merge props and ownerState the same way it's done in MUI System's createStyled

cc: @mnajdova

@DiegoAndai DiegoAndai added the type: bug It doesn't behave as expected. label May 28, 2024
@DiegoAndai DiegoAndai requested a review from brijeshb42 May 28, 2024 14:42
@DiegoAndai DiegoAndai self-assigned this May 28, 2024
@DiegoAndai DiegoAndai changed the title Implement variant matching parity [fix] Implement variant matching parity May 28, 2024
@DiegoAndai
Copy link
Member Author

Before and after

Textfield demos with 0.0.10:

Screen.Recording.2024-05-28.at.12.31.48.mov

Textfield demos with this PR's build:

Screen.Recording.2024-05-28.at.12.30.31.mov

@brijeshb42 when running the demos with this PR's build, the following code on one of the demos errored:

function RedBar() {
  return (
    <Box
      sx={{
        height: 20,
        backgroundColor: (theme) =>
          theme.palette.mode === 'light'
            ? 'rgba(255, 0, 0, 0.1)'
            : 'rgb(255 132 132 / 25%)',
      }}
    />
  );
}

With:

theme is not defined

This didn't happen when running with 0.0.10. Why might this be? I would expect it to fail on both versions, specially as this change is not related to the sx prop or theme handling.

@brijeshb42
Copy link
Contributor

brijeshb42 commented May 28, 2024

I'll have to check. There was a change by @siriwatknp where he changed the callback argument from being ({theme}) => to (theme) => to be same as system. This might be the reason.

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.

@brijeshb42 brijeshb42 merged commit e4bb1a2 into mui:master May 29, 2024
@DiegoAndai DiegoAndai deleted the owner-state-resolution-parity branch May 29, 2024 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants