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

Hydration Error in React 19 with Pigment CSS and MuiSvgIcon fontSize prop #44675

Open
wh5938316 opened this issue Dec 6, 2024 · 5 comments
Open
Assignees
Labels
package: material-ui Specific to @mui/material status: waiting for maintainer These issues haven't been looked at yet by a maintainer

Comments

@wh5938316
Copy link

wh5938316 commented Dec 6, 2024

Steps to reproduce

Steps:

  1. Update to React 19.
  2. Update to Next 15.
  3. Use Pigment CSS alongside MUI.
  4. Override the MuiSvgIcon component’s variants.fontSize.small in the custom theme.
export default withPigment(nextConfig, {
  theme: createTheme({
    cssVariables: true,
    components: {
      MuiSvgIcon: {
        styleOverrides: {
          root: {
            fill: 'currentColor',
            color: 'inherit',
            variants: [
              {
                props: {
                  fontSize: 'small',
                },
                style: {
                  fontSize: '1rem',
                },
              },
            ],
          },
        },
      },
    }
  }),
  transformLibraries: ['@mui/material'],
});
  1. Set the fontSize prop on an MuiSvgIcon component in the app.
<SvgIcon fontSize="small">
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
    <path d="M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z" />
  </svg>
</SvgIcon>

Current behavior

No response

Expected behavior

image

Context

No response

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: pigment-css, react19, next15, hydration error

@wh5938316 wh5938316 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 6, 2024
@mj12albert
Copy link
Member

@wh5938316 Would you mind providing a repro in codesandbox or stackblitz?

@mj12albert mj12albert added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Dec 7, 2024
@wh5938316
Copy link
Author

wh5938316 commented Dec 7, 2024

@wh5938316 Would you mind providing a repro in codesandbox or stackblitz?

@mj12albert
here is codesandbox link
the github repo

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels Dec 7, 2024
@zannager zannager added the package: material-ui Specific to @mui/material label Dec 10, 2024
@DiegoAndai DiegoAndai assigned brijeshb42 and unassigned mj12albert Dec 12, 2024
@DiegoAndai
Copy link
Member

@brijeshb42 may I ask you to identify if this is on Pigment CSS or Material UI side?

@wh5938316
Copy link
Author

@brijeshb42 @DiegoAndai Hi, Is there any progress on this issue?

@brijeshb42
Copy link
Contributor

Hey. It went out of my radar. I'll check this today and get back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: material-ui Specific to @mui/material status: waiting for maintainer These issues haven't been looked at yet by a maintainer
Projects
None yet
Development

No branches or pull requests

5 participants