I\'ve read the documentation, but I didn\'t really understand the difference between hydrate()
and render()
in React 16.
I know hydrate()
In addition to above...
ReactDOM.hydrate()
is same as render()
, but it is used to hydrate(attach event listeners) a container whose HTML contents were rendered by ReactDOMServer. React will attempt to attach event listeners to the existing markup.
Using ReactDOM.render() to hydrate a server-rendered container is deprecated because of slowness and will be removed in React 17 so use hydrate()
instead.