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

[bug] The styled function does not work with MUI system #36

Open
siriwatknp opened this issue Apr 26, 2024 · 1 comment
Open

[bug] The styled function does not work with MUI system #36

siriwatknp opened this issue Apr 26, 2024 · 1 comment
Labels
bug 🐛 Something doesn't work

Comments

@siriwatknp
Copy link
Member

siriwatknp commented Apr 26, 2024

Steps to reproduce

See https://github.com/mui/material-ui/actions/runs/8837080528/job/24265117421?pr=41663 in mui/material-ui#41663

Current behavior

ownerState is undefined in InputBase styles when FilledInput (Pigment) is wrapping Input (MUI System).

const FilledInputRoot = styled(InputBase)()

The root cause is that FilledInputRoot does not forward ownerState to InputBase which causes an error from the InputBase.

Expected behavior

They should work together, both MUI System wrappin Pigment or Pigment wrapping MUI System.

Context

Found this issue when trying to migrate only FilledInput to support Pigment CSS.

Your environment

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

Search keywords: styled

@siriwatknp siriwatknp added status: waiting for maintainer These issues haven't been looked at yet by a maintainer bug 🐛 Something doesn't work and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Apr 26, 2024
@mnajdova mnajdova changed the title styled does not work with MUI system [bug] The styled function does not work with MUI system Apr 26, 2024
@mnajdova
Copy link
Member

The root cause is that FilledInputRoot does not forward ownerState to InputBase which causes an error from the InputBase.

Can't we use the shouldForwardProp for this? Can you create a simplified stackblitz to showcase the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work
Projects
None yet
Development

No branches or pull requests

2 participants