Skip to content
This repository was archived by the owner on Jul 1, 2020. It is now read-only.

This package is unsafe to use #10

Open
wereHamster opened this issue Jul 1, 2020 · 1 comment
Open

This package is unsafe to use #10

wereHamster opened this issue Jul 1, 2020 · 1 comment

Comments

@wereHamster
Copy link

The component renders a different markup on the server vs on the client. This causes issues, such as those described by reactjs/react.dev#25.

If you are lucky then react will patch the differences. If you are not so lucky then the differences will remain and cause issues. For example if the server renders <div className="foo"> and the client renders <div className="bar">, then the difference in the className prop will not be patched up and the element will be styled incorrectly.

@mnebuerquo
Copy link

It's actually worse than that. If you hydrate the dom and there are elements that React can't match to a virtual DOM node, it won't remove them from the DOM unless it re-renders their parent. Instead you get zombie nodes which React won't remove, won't re-render, and won't connect to event handlers. The rest of the page works and is interactive, but those zombie nodes remain.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants