-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
dangerouslyUseGlobalCSS not working #12275
Comments
@grigored Please provide a full reproduction test case. This would help a lot 👷 . |
@oliviertassinari Thanks for the quick reply. Here's a sample repo to demonstrate the problem: https://github.com/grigored/dangerouslyUseGlobalCS. In the |
@grigored Thanks, the I guess we should document it. |
Is there an additional step that has to be taken for custom components outside MUI? I'm writing a button wrapper and despite being inside my |
@briman0094 I haven't anticipated this extra logic: |
Aha...yeah, didn't think to look in the createGenerate file. That would certainly explain it ;) |
@oliviertassinari Yes, I also had this problem and I was commenting that line to make it work. I think it should be removed. |
@grigored @briman0094 We can't just "remove" it, but we can definitely remove this requirement. I will work on that. |
I worked around it by writing a wrapper for the |
I did a little debugging to figure out why
dangerouslyUseGlobalCSS
is not working, and it seems thatstyleSheet.options.classNamePrefix
is undefined. My app was created with create-react-app, so this might be a problem with how webpack obfuscates class names? Is there any known workaround for this?Steps to Reproduce
Link:
Here's a sample code showing the problem.
Context
Your Environment
The text was updated successfully, but these errors were encountered: