Material UI wont add styles on refreshing
See original GitHub issueFirst, 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.
Issue Analytics
- State:
- Created 4 years ago
- Comments:17 (1 by maintainers)
Top Results From Across the Web
Material-UI breaks after refreshing - Stack Overflow
My problem is that the styling on the site completely breaks whenever I press the reloading button on the browser. Is this normal...
Read more >Frequently Asked Questions - Material UI - MUI
Possible reasons · You have another @mui/styles library somewhere in your dependencies. · You have a monorepo structure for your project (e.g, lerna,...
Read more >@mui/styles (LEGACY) - MUI System
@mui/styles is the legacy styling solution for MUI. It depends on JSS as a styling solution, which is not used in the @mui/material...
Read more >Working with Tailwind CSS - MUI Base
Learn how to style MUI Base components with Tailwind CSS. ... create a file called Player.tsx and add the markup below, which includes...
Read more >Accordion API - Material UI - MUI
API reference docs for the React Accordion component. Learn about the props, CSS, and other APIs of this exported module.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.