-
Notifications
You must be signed in to change notification settings - Fork 10.3k
gatsby build does not call componentWillMount() #10912
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
Comments
Hey @cpboyd Can you please link to a minimal reproduction of this? |
@sidharthachatterjee Based on the "using-redux" example from this repo: All pages should initially display a That's the behavior with However,
Note that the initial |
I've pushed an update to https://github.com/cpboyd/gatsby-redux-bug that moves the This seems to somewhat resolve the issue, except that the page initially renders with 0 because the |
OK, so it seems to be standard React behavior: That said, the current redux example should probably be modified to avoid suggesting a static Redux store for rendering. |
Uh oh!
There was an error while loading. Please reload this page.
Description
The redux state for the current page doesn't seem to be cleared from a prior rendering or updated by
componentWillMount()
before being rendered.Possibly due to asynchronous rendering?
Steps to reproduce
wrapRootElement()
componentWillMount()
Expected result
State changes implemented in
componentWillMount()
should take effect BEFORE the page is rendered.Ideally, each page seems like it should be rendered from the initial redux state as well without any potential prior path issues.
Actual result
Pages render with incorrect redux state.
Environment
The text was updated successfully, but these errors were encountered: