When using the Gatsby styled-component plugin, the layout is currently broken if the very first re-hydration doesn't match perfectly the SSR version — instead of having a small flash and a client rendering as it does without this plugin.
I created a minimal reproduction at https://github.com/mquandalle/repro-gatsby-issue-5993
This should be fixable with the ssr option of the babel plugin for styled-components: https://www.styled-components.com/docs/tooling#serverside-rendering
Seems you're right that we need to activate SSR during the JS build as well. Could you create a PR for that?
I haven't actually tested that yet but I will do it and do a PR if it works.
Any solution for this yet?
Seems like this is still an issue?
https://github.com/styled-components/styled-components/issues/2629#issuecomment-561318866