Description
We've updated an application to React 16, this app is using react-responsive
.
Since we've updated to React 16, we have bugs related to invalid HTML being outputted by React hydration.
Our server generates an HTML for the desktop, but if the client has a mobile, the rendering mismatch. Previously it was causing a full re-render by ReactDOM.render
, it was not perfect, but it worked.
With React 16, ReactDOM.hydrate
is supposed to not-rerender everything but only the mismatching parts. But after we run ReactDOM.hydrate
, the HTML is an invalid mix of both (class
are sliced).
1) HTML generated by the server (desktop mode)
This is the HTML being served by the server (before hydration):
2) HTML generated by the client without SSR (normal mobile mode)
This is the HTML being rendered by React, when we disable SSR:
3) Wrong HTML generated by hydration of 1) in client (mobile mode)
This is the invalid HTML being rendered by React when it tries to hydrate 1) with 2). The expected HTML is 2).
Versions
Chrome 61.0.3163.100
React v16.0.0