react-starter-kit: Material UI wont add styles on refreshing
First, I am not sure how to exactly add Material UI support. I added by doing this in client.js
<App context={context} insertCss={insertCss}>
<MuiThemeProvider>
<CssBaseline />
{route.component}
</MuiThemeProvider>
</App>
Please tell whats the right way to integrate material UI. Material UI applies styles well when server starts. But at next refresh none of styles defined inside component are applied. I apply component wise styles using.
const useStyles = makeStyles(theme => ({
root: {
color: 'red',
},
})
export function example() {
const classes = useStyles()
return (
<div className={classes.root}> Hello</>
)
}
Please help.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 17 (1 by maintainers)
I added the theme in App.js and made changes to server.js to include server side rendering things. A part of server.js looks like this
Hope it helps…
@piglovesyou Thanks for the help ❤️. It worked.