-
Notifications
You must be signed in to change notification settings - Fork 26.3k
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
Simplify styled-components example #5631
Simplify styled-components example #5631
Conversation
- use `enhanceApp` so that styled-components used in _app.js are server rendered - call parent getInitialProps, fixes vercel#5629 - return `styles`, making the render() method obsolete.
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.
Going to defer to @timneutkens for a review of the Next stuff, but from a s-c perspective this looks fine!
EDIT: I'm a dummy and didn't realize you had changed your avatar. 🤦♂️ 🤦♂️ 🤦♂️ 🤦♂️
Shipit!
@mxstbr I am @timneutkens 😂 😄 |
Nice! @timneutkens What is |
@sarneeh It was a change introduced here #4762 Usage before #4762 was: renderPage(Page => Page) This applied the Now, it also takes an options object(although previous behaviour was kept for backwards compatibility): renderPage({
enhanceApp: App => App,
ehhanceComponent: Component => Component
}) As @timneutkens mentioned here
|
@klujanrosas Thank you for the explanation! I didn't stumble upon this PR 😄 |
Honestly I think we can document this by now with the approach taken in this PR. The reason I said not to document it was because |
Hey @timneutkens , do you think it should it be documented on the repo's README? I went ahead and gave it a shot in #5723 |
The repo readme |
…cument.js (#5723) Per @timneutkens suggestion [here](#5631 (comment)) I went ahead and gave a shot at trying to document `renderPage` usage. This PR: - Documents `renderPage` legacy and current usage.
enhanceApp
so that styled-components used in _app.js are server renderedstyles
, making the render() method obsolete.cc @mxstbr @probablyup