React 16 warning "warning.js:36 Warning: Did not expect server HTML to contain a <div> in <div>."

David Furlong picture David Furlong · Jul 27, 2017 · Viewed 55.6k times · Source

I'm using the React 16 beta (react-fiber) with server side rendering

What I am to understand this to mean?

warning.js:36 Warning: Did not expect server HTML to contain a <div> in <div>.

Answer

Sagar picture Sagar · Jun 15, 2018

Just change express response from

<body>
    <div id="root">
        ${markup}
    </div>
</body>

to

<body>
    <div id="root">${markup}</div>
</body>

Remove space between tags