Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React 16: Warning: Expected server HTML to contain a matching <div> in <body>

Tags:

reactjs

Since upgrading to React 16 I get this error message:

warning.js:33 Warning: Expected server HTML to contain a matching <div> in <body>.

What is generally causing this error message and how can it be fixed?

like image 879
Anton Avatar asked Sep 27 '17 09:09

Anton


1 Answers

If you use ReactDOM.hydrate to start web application, you will see this warning.

If your application does not use server-side rendering (ssr), please use ReactDOM.render to start.

like image 106
Jay Hu Avatar answered Sep 26 '22 16:09

Jay Hu