-
Notifications
You must be signed in to change notification settings - Fork 29.9k
Closed
Description
While running Redux example on server with UTC time set, I've got these errors in my browser console because of timezone differences:
next-dev.bundle.js:8985 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) " data-reactid="1">15:03:39
(server) " data-reactid="1">12:03:39
Possible fix is to change Clock.js :13 from:
const format = t => `${pad(t.getHours())}:${pad(t.getMinutes())}:${pad(t.getSeconds())}`
to:
const format = t => `${pad(t.getUTCHours())}:${pad(t.getUTCMinutes())}:${pad(t.getUTCSeconds())}`
altaywtf, dlindenkreuz, VictorVolovik and impronunciable
Metadata
Metadata
Assignees
Labels
No labels