I was trying to create a themed app with MUI BaseUi using ThemeProvider
and createTheme
as described in the docs. But in my app the theme is not used.
I am using @mui/base 5.0.0-beta.8 together with @mui/system 5.14.1 and @emotion/react 11.11.1
App.tsx:
import { ReactElement } from "react";
import {ThemeProvider} from "@mui/system";
import {myTheme} from "./themes/mytheme.tsx";
export default function RdApp(): ReactElement {
return <ThemeProvider theme={myTheme}>
<div>Hello world</div>
</ThemeProvider>
}
thems/mytheme.ts:
import {createTheme} from "@mui/system";
export const myTheme = createTheme({
typography: {
fontFamily: "Arial"
},
});
CodeSandbox: https://codesandbox.io/p/sandbox/dry-dew-z593g5