import * as React from 'react'; import { MuiThemeProvider, createMuiTheme } from '@material-ui/core/styles'; import purple from '@material-ui/core/colors/purple'; import green from '@material-ui/core/colors/green'; import CssBaseline from '@material-ui/core/CssBaseline'; // A theme with custom primary and secondary color. // It's optional. const theme = createMuiTheme({ palette: { primary: purple, secondary: green, }, }); function withRoot

(Component: React.ComponentType

) { function WithRoot(props: P) { // MuiThemeProvider makes the theme available down the React tree // thanks to React context. return ( {/* CssBaseline kickstart an elegant, consistent, and simple baseline to build upon. */} ); } return WithRoot; } export default withRoot;