Moving from CRA to Gatsby broke JSS plugins
See original GitHub issueIn create-react-app
I was using react-jss
because for the jss-plugin-expand
plugin is not included by default.
I had <StylesProvider jss={reactJss}>
and all worked fine. However, now I switched to Gatsby and the exact same setup stopped working.
flex: [1, 1, '70px']
is now compiled to flex: 1, 1, 70px
(with commas).
import React from 'react'
import { jss } from 'react-jss'
import { StylesProvider, ThemeProvider } from '@material-ui/core/styles'
import CssBaseline from '@material-ui/core/CssBaseline'
export default function PagesLayout({children}){
return (
<StylesProvider jss={jss}>
<ThemeProvider theme={theme}>
{children}
</ThemeProvider>
</StylesProvider>
)
}
The only difference I can think of, is that now this file is a wrapper, and has {children}
instead of <App/>
versions:
"react-jss": "^10.3.0",
"@material-ui/core": "^4.11.0",
"react": "^16.12.0",
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Moving from CRA to Gatsby broke JSS plugins - Stack Overflow
In create-react-app I was using react-jss because for the jss-plugin-expand plugin is not included by default. I had <StylesProvider jss={ ...
Read more >Moving from CRA to Gatsby broke JSS plugins #22200 - GitHub
In create-react-app I was using react-jss because for the jss-plugin-expand plugin is not included by default. I had and all worked fine.
Read more >Porting from Create React App to Gatsby
gatsby -plugin-image will create optimized versions of your images in different sizes, loading a smaller, optimized version of an image and replacing it...
Read more >Moving Create-React-App to Gatsby.js : r/gatsbyjs - Reddit
Hi. I have recently learnt react and created an app via Create-React-App. I would like to port it over to Gatsby.js and I'm...
Read more >Learn how to migrate a create-react-app project to Gatsby!
Learn how to migrate a create-react-app project to Gatsby! ... Explaining Gatsby plugins; Breaking down CRA routes into pages(static and client side) ...
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
We don’t support nor own react-jss
Thanks for sharing the solution!