Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After server render, missing nodes are not re-created with correct className #11104

Closed
dustinsoftware opened this issue Oct 5, 2017 · 1 comment

Comments

@dustinsoftware
Copy link
Contributor

Possible regression - it looks like re-creating missing nodes is not working correctly in React 16. The nodes get re-created, but one of them will copy the className from a sibling node, instead of getting re-created with the correct className.

Here's a pen demonstrating the issue. It works just fine in React 15.

JSX:
screen shot 2017-10-04 at 10 00 33 pm

Rendered HTML:
screen shot 2017-10-04 at 10 01 19 pm

@gaearon
Copy link
Collaborator

gaearon commented Oct 5, 2017

This sounds like expected behavior in 16.

React 16 doesn't guarantee that the result will be correct if there is a mismatch. It inserts extra nodes but doesn't patch up the attributes because it would be pretty expensive and negate the performance benefits.

It is expected that you will fix mismatches in development so that the app can be fast in production. We plan to document it more prominently in the future.

You can read more in #10591.

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

No branches or pull requests

2 participants