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

[next-app-dir] Button variant="contained" Prop className did not match. #39003

Closed
2 tasks done
mtr1990 opened this issue Sep 15, 2023 · 1 comment
Closed
2 tasks done
Labels
component: button This is the name of the generic UI component, not the React module!

Comments

@mtr1990
Copy link

mtr1990 commented Sep 15, 2023

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Steps:

1.Using Button in next-app-dir
2.Console show error with variant="contained"

Current behavior 😯

  1. With variant="contained"
import Button from '@mui/material/Button';

export const metadata = {
  title: 'Page',
};

export default function Page() {
  return (
    <Button color="primary" size="large" variant="contained">
      figma workspace
    </Button>
  );
}
Screenshot 2023-09-16 at 02 20 36
  1. With variant="outlined" (No error)
import Button from '@mui/material/Button';

export const metadata = {
  title: 'Page',
};

export default function Page() {
  return (
    <Button color="primary" size="large" variant="outlined">
      figma workspace
    </Button>
  );
}
Screenshot 2023-09-16 at 02 20 13
  1. With variant="text" (No error)
import Button from '@mui/material/Button';

export const metadata = {
  title: 'Page',
};

export default function Page() {
  return (
    <Button color="primary" size="large">
      figma workspace
    </Button>
  );
}
Screenshot 2023-09-16 at 02 20 13

Expected behavior 🤔

No error displayed

Context 🔦

Test on Dark Mode.
In Light Mode everything works fine.

Your environment 🌎

No response

@mtr1990 mtr1990 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Sep 15, 2023
@mtr1990 mtr1990 closed this as completed Sep 15, 2023
@zannager zannager added component: button This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Sep 18, 2023
@shieldz80
Copy link

shieldz80 commented Oct 16, 2023

@mtr1990 Did you find a solution to this? This is still happening for me anytime I use dark theme (next js 13 with app dir). It even happens with the example app (https://github.com/mui/material-ui/tree/master/examples/material-ui-nextjs-ts) and as a result the component which causes the error does not have dark theme applied.

Screenshot from 2023-10-16 17-03-47

You can see in the screenshot that header is broken, that's where the error occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: button This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

3 participants