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

React 16 Server Side Rendering client/server mismatched Html differences #11248

Closed
skingston91 opened this issue Oct 17, 2017 · 5 comments
Closed

Comments

@skingston91
Copy link

skingston91 commented Oct 17, 2017

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Migrating to React 16 helped us discover a bug in our code for only Safari/IOS devices where the sort functionality would cause the result to return in a different order compared to node's server response or chrome/firefox. The rendered component is a component with an A tag wrapping an optional image and h2 elements.

In React 15 the components completely re-rendered overriding the tag with the new url from the client.
In React 16 the client component re-rendered everything inside of the but didn't change the wrapped url. Which lead to links leading peoples to incorrect locations.

Hopefully that makes sense!

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template for React 16: https://jsfiddle.net/Luktwrdm/, template for React 15: https://jsfiddle.net/hmbg7e9w/).
I don't know a good way of creating a fiddle for this. However I'll do my best to answer any questions

What is the expected behavior?
I would have expected the client side html to have overridden the server side html the same as React 15 did and completely rerender the component.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
Functionally different from React 15 to React 16. Not sure if what I've listed was intended changes in React 16 which is why I'm raising it to make you aware just incase it is an issue.

@gaearon
Copy link
Collaborator

gaearon commented Oct 17, 2017

Please see the discussion in #10591.
This behavior is expected.

We documented it as a breaking change now: reactjs/react.dev#116.
Although we should do it more prominently in the future.

@gaearon gaearon closed this as completed Oct 17, 2017
@skingston91
Copy link
Author

skingston91 commented Oct 17, 2017

@gaearon My mistake, didn't see that. Thanks for the information!

@gaearon
Copy link
Collaborator

gaearon commented Oct 17, 2017

No worries! It is a bit confusing, I agree.

@skingston91
Copy link
Author

React 16 is now back into production for us and performance has greatly improved, thanks for the great work on it!

@gaearon
Copy link
Collaborator

gaearon commented Oct 18, 2017

Glad to hear that!

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