-
-
Notifications
You must be signed in to change notification settings - Fork 801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[legacy-framework] Recipe: Styled Components #2087
[legacy-framework] Recipe: Styled Components #2087
Conversation
…ld the theme and global styles. Still need to finish codeshift changes to _document.tsx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @kevinlangleyjr! Nice work, I like it.
In Next.js's official styled-components example, styleSheet.seal() gets called:
Is there a reason this is not included in this recipe?
Also, babel-plugin-styled-components
is installed but not added to babel.config.js
. Take a look at how the emotion / reflexjs recipes do this, I think you can adapt their code.
Doh! You're right @Skn0tt - I forgot about the My latest commits correctly add the try/finally, Let me know if there is anything else needed to get this merged 🙂 |
@allcontributors please add kevinlangleyjr for code |
@kevinlangleyjr already contributed before to code |
What are the changes and their implications?
This PR adds a recipe to integrate
styled-components
.Within the recipe, we're using the same method of adding a customized
getInitialProps
as thematerial-ui
recipe, here.I also think this would be greatly benefited by changing the logic to to check if the method already exists and modify it, instead of always adding it and assuming that it hasn't already been added.
But I also think it's a good idea to provide a recipe for this sooner rather than later. When we build out the logic to conditionally adjust the
getInitialProps
method, we can use the same logic here and in thematerial-ui
recipe.Checklist