What's the difference between hydrate() and render() in React 16?

后端 未结 6 845
我寻月下人不归
我寻月下人不归 2021-01-30 05:53

I\'ve read the documentation, but I didn\'t really understand the difference between hydrate() and render() in React 16.

I know hydrate()

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-30 06:52

    The entire process of putting functionality back into the HTML that was already rendered in server side React is called hydration.

    So the process of re-rendering over the once rendered HTML is referred to as hydration.

    So if we try to hydrate our application by calling ReactDOM.render() its supposed to be done by calling ReactDOM.hydrate().

提交回复
热议问题