chrisleee / twitch-stocks

A web platform that allows you to invest in Twitch streamers with imaginary points.
GNU General Public License v3.0
21 stars 8 forks source link

Fix server side rendering #84

Closed jallier closed 7 years ago

jallier commented 7 years ago

This error crops up:

Warning: React attempted to reuse markup in a container but the checksum was invalid. This generally means that you are using server rendering and the markup generated on the server was not what the client was expecting. React injected new markup to compensate which works but you have lost many of the benefits of server rendering. Instead, figure out why the markup being generated is different on the client or server:
 (client) /nav><div class="sc-bwzfXH hDlKEE" data-
 (server) /nav><div class="sc-jzJRlG draELm" data-

I believe its related to styled components, specifically the extend feature. Unsure of how to fix.

chrisleee commented 7 years ago

I think upgrading Styled Components to the latest version fixes this since they have a patch for extend and SSR. Haven't extensively tested yet though.