-
-
Notifications
You must be signed in to change notification settings - Fork 898
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
Why does withLayout need to call it's child's getInitialProps method? #185
Comments
found this, hopefully it may help others: vercel/next.js#159 (comment) |
not sure whether to keep this open or closed so people can see it or not... I'll let admins decide |
@orpheus Thanks for your question and answer. I think we should add this explanation to the book. I will close this issue after we add an explanation to book's text. |
@orpheus Thanks for researching and posting explanation. Here is another link:
Your original link: Few things to remember about
|
For instance, /pages/customer/my-books has a getInitialProps and it is wrapped with withLayout HOC. withLayout calls the getInitialprops of my-books js, but if you comment it out in the HOC, my-books won't run getInitialProps itself. How is it determined when getInitialProps will run. The docs aren't very clear. I was under the impression that each component calls it's own getInitialProps right before it's about to get rendered.
The text was updated successfully, but these errors were encountered: