Gatsby changing the layout of components. #31763
-
DescriptionFirst of all, thank you so much for making Gatsby! I am having this issue since the start of my gatsby journey, I thought it was from my side, but after long research, I couldn't find any solution. I have seen many issues regarding gatsby changing the production styles, maybe it is related to same bug. What gatsby is doing is replicating the wrapper element of any component, at any time, on any environment (i-e dev or production) randomly, I couldn't find any specific condition triggering this bug. What gatsby is actually rendering: (See the duplicate wrapper of text component)Steps to reproduceHere's the link to repo:
Expected resultHere are the screenshot of all the pages layout. Create lolly page /create-lolly Actual resultEnvironmentWindows 10 Run
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It's not a bug per se and also not specific to Gatsby as it can happen on every platform that generates HTML/CSS/JS and then rehydrates that content on the client (Rehydration). Somewhere in your code you could e.g. make the assumption that the You could give this a read and check your code afterwards: https://www.joshwcomeau.com/react/the-perils-of-rehydration/ |
Beta Was this translation helpful? Give feedback.
It's not a bug per se and also not specific to Gatsby as it can happen on every platform that generates HTML/CSS/JS and then rehydrates that content on the client (Rehydration). Somewhere in your code you could e.g. make the assumption that the
window
element exists and then duringgatsby build
that part will beundefined
and your HTML will be different than what on the client will be rendered.You could give this a read and check your code afterwards: https://www.joshwcomeau.com/react/the-perils-of-rehydration/