材料-ui:v4.8.2
反应:v16.12.0
带有 rtl 应用程序的 babel-plugin-react-css-modules - 我想使用 injectFirst 但后来我收到警告:
Material-UI: you cannot use the jss and injectFirst props at the same time.
我的猜测是我应该以不同的方式定义 jss,以便它支持 rtl 和 css 模块。
// Configure JSS - How should I add here the css-modules styles?
const jss = create({ plugins: [...jssPreset().plugins, rtl()] });
对于 rtl 我应该这样做:
// Configure JSS
const jss = create({ plugins: [...jssPreset().plugins, rtl()] });
<StylesProvider jss={jss}>
<ThemeProvider theme={theme}>
<AppContainer />
</ThemeProvider>);
</StylesProvider>
对于 css-modules 样式,我应该这样做:
<StylesProvider injectFirst>
<ThemeProvider theme={theme}>
<AppContainer />
</ThemeProvider>);
</StylesProvider>
谁能告诉我应该如何将两者结合起来?