mui / material-ui

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
https://mui.com/material-ui/
MIT License
93.64k stars 32.22k forks source link

Support babel-plugin-react-css-modules and rtl #19252

Closed chenop closed 4 years ago

chenop commented 4 years ago

babel-plugin-react-css-modules with rtl app - I thought to use injectFirst but then I get a warning: Material-UI: you cannot use the jss and injectFirst props at the same time.

My guess is that I should define differently the jss so it would support rtl and css modules. // Configure JSS const jss = create({ plugins: [...jssPreset().plugins, rtl()] }); // How should I add here the css-modules styles

Current Behavior 😯

for rtl I should do:

// Configure JSS
const jss = create({ plugins: [...jssPreset().plugins, rtl()] });

<StylesProvider jss={jss}>
            <ThemeProvider theme={theme}>
                <AppContainer />
            </ThemeProvider>);
        </StylesProvider>

for css-modules styles I should do:

<StylesProvider injectFirst>
            <ThemeProvider theme={theme}>
                <AppContainer />
            </ThemeProvider>);
        </StylesProvider>

Cant combine both AFAIK.

Expected Behavior 🤔

Please advice how can I do both

Tech Version
Material-UI v4.8.3
React 16.12.0
Browser Chrome
TypeScript No
support[bot] commented 4 years ago

👋 Thanks for using Material-UI!

We use GitHub issues exclusively as a bug and feature requests tracker, however, this issue appears to be a support request.

For support, please check out https://material-ui.com/getting-started/support/. Thanks!

If you have a question on StackOverflow, you are welcome to link to it here, it might help others. If your issue is subsequently confirmed as a bug, and the report follows the issue template, it can be reopened.