Closed salehhamadeh closed 6 years ago
Bo and I talked offline. We decided to update react-hot-loader to v3.1.1. Server-side hot reloading will continue to work, so making a change and refreshing the page will show the changes. However, client-side hot reloading is broken because React 16 does not have ReactMount, which react-hot-loader v1 depended on. I will open an issue for the broken client-side hot module replacement.
This PR only upgrades React to v16.0.0. It does not use any new features, aside from changing
React.render
toReact.hydrate
inClientController
. I thought about usingReact.renderToNodeStream
instead ofReact.renderToString
inrenderMiddleware.getElements
, but I was not sure what is the best way to do it. I was thinking of having a stream for everyRootElement
that are all read and poured into a higher-level stream. I do not know if this will work. If you have ideas let me know, and I can either include it in this PR or in a separate one.I used react-codemod (https://github.com/reactjs/react-codemod) to refactor PropTypes and React.createClass. I tested all react-server-test-pages. The only test page that behaves differently is the Error Logging Tests Page. Instead of the buttons logging errors and staying on the page, they are completely removed. This is the expected behavior since the introduction of error boundaries in React 16 https://reactjs.org/blog/2017/07/26/error-handling-in-react-16.html