So I am using wrapPageElement to wrap pages with a layout that I don't want remounting when transitioning from page to page. What's weird is that when I start on a page and go to any page other than home for the first time everything remounts. Then if I go back to the first page that I already accessed it transitions as it should. Plus, if I start on any page other than the homepage then go to the homepage it transitions the way it should. All of my pages are being created during build with createPage. Any ideas??
Hello @kmcaloon!
Sorry to hear you are having an issues. I wonder if you could produce a minimal reproduction for this issue, this would help us immensely in trying to debug it.
Thanks! :purple_heart: :muscle:
Very similar to what I've raised: #16243
In development mode, JSONStore detaches page while page data fetching and this cause page rerender:
https://github.com/gatsbyjs/gatsby/blob/d055527b3be04639d572b052535c7c13b7317efe/packages/gatsby/cache-dir/json-store.js#L85-L95
This happens if we did not visit this page yet and a page data was not prefetched.
Awesome, thanks for the clarification @ValeraS. Is this necessary to have in development? If so, the docs probably want to indicate that layouts will not always function as expected when developing.
Hiya!
This issue has gone quiet. Spooky quiet. 馃懟
We get a lot of issues, so we currently close issues after 30 days of inactivity. It鈥檚 been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!
Thanks for being a part of the Gatsby community! 馃挭馃挏
Hey again!
It鈥檚 been 30 days since anything happened on this issue, so our friendly neighborhood robot (that鈥檚 me!) is going to close it.
Please keep in mind that I鈥檓 only a robot, so if I鈥檝e closed this issue in error, I鈥檓 HUMAN_EMOTION_SORRY. Please feel free to reopen this issue or create a new one if you need anything else.
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!
Thanks again for being part of the Gatsby community!
Most helpful comment
In development mode,
JSONStoredetaches page while page data fetching and this cause page rerender:https://github.com/gatsbyjs/gatsby/blob/d055527b3be04639d572b052535c7c13b7317efe/packages/gatsby/cache-dir/json-store.js#L85-L95
This happens if we did not visit this page yet and a page data was not prefetched.