-
Notifications
You must be signed in to change notification settings - Fork 47k
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
Bug: ReactDom.hydrate detects but doesn´t fix diff #11064
Comments
In my understanding it is not expected to patch up the differences since doing that in production is too expensive and negates the performance benefits from the new approach. See also #10591 (comment). |
(If you intentionally want to render something different on the client, one popular approach is to set a boolean state flag like |
Ok, thanks. - then I think the docs are a bit misleading or at least unclear:
|
I agree, would you like to send a PR to make it clearer? |
I have an intentional difference in the client vs server rendering: an Image component that displays a different src depending on the screen pixel density:
What is the current behavior?
When I render this on a retina screen, I get this warning:
But, the browser shows the server-rendered content, and not the correct client one.
What is the expected behavior?
That the client mutates the dom and changes the src attribute of the img.
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
react 16.0.0 Chrome 61.0.3163.100. In previous versions of react this was not a good approach because render() would then re-render the whole DOM instead of just the diff.
The text was updated successfully, but these errors were encountered: