material-ui: v4.8.2
react: v16.12.0
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 - How should I add here the css-modules styles?
const jss = create({ plugins: [...jssPreset().plugins, rtl()] });
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>
Can anyone please advise how I should combine both?
Finally solved it.
Do the following:
Add
jss-insertion-pointjust below the<head>Root.js: