Joel Purra: Developer and more


Remove breaking formatting in HTML template

Repository details (talkie)
Project page
talkie
Project category
(588 entries)
Repository
talkie on Github@joelpurra/talkie
Owner
joelpurra on Github@joelpurra
Commit details (96db94a8)
Author
Authored at
Commiter
Joel Purra
Commited at

Commit message

Remove breaking formatting in HTML template

- During "server-side" prerendering, the HTML templates are populated with HTML and JSON state from the initial rendering pass.
- During development, automatic HTML formatting in Visual Studio Code has inserted extra whitespace/newlines to the `react-root` and `__PRERENDERED_STATE__` elements.
- This extra whitespace yields warnings in React.js (in development mode), as the mismatch means client-side rehydration is not perfect.
- For performance reasons, it's better to have a perfect match between HTML/state of both the server and client.
- Code formatting tooling and editors may change, so be mindful of future changes.

See

- https://reactjs.org/docs/react-dom.html#hydrate

Changed files (2)

Commit categories (3)