根据我在root元素上使用StylesProvider的Material-UI文档,我想立即用jss替换所有组件:
import { create } from 'jss';
import rtl from 'jss-rtl';
import { StylesProvider, jssPreset } from '@material-ui/core/styles';
const jss = create({ plugins: [...jssPreset().plugins, rtl()] });
const App = () => (
<StylesProvider jss={jss}>
<Admin locale="ar" i18nProvider={i18nProvider} theme={theme} layout={layout}>
</Admin>
</StylesProvider>
);
export default App;
但我收到此错误:
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports
那我在做什么错了?