React 15 support - "attempted to reuse markup" #252

Closed
wub opened this Issue Apr 12, 2016 · 3 comments

Projects

None yet

4 participants

@wub
wub commented Apr 12, 2016

https://facebook.github.io/react/blog/2016/04/07/react-v15.html

React 15 changed the way components are rendered (regarding react-id etc), which causes this error for me when using @Html.React:

Warning: React attempted to reuse markup in a container but the checksum was invalid.
This generally means that you are using server rendering and the markup generated on the
server was not what the client was expecting. React injected new markup to compensate which
works but you have lost many of the benefits of server rendering. Instead, figure out why the
markup being generated is different on the client or server:
 (client) <div data-reactroot="" data-reactid
 (server) <div data-reactid=".1hrhaz20mio"

When I downgrade to React 0.14.x, this is resolved.

@Daniel15
Member

Yes, ReactJS.NET doesn't use React 15 yet. I'll update it shortly.

Sent from my phone.
On Apr 11, 2016 7:01 PM, "Jarrod Mosen" notifications@github.com wrote:

https://facebook.github.io/react/blog/2016/04/07/react-v15.html

React 15 changed the way components are rendered (regarding react-id
etc), which causes this error for me when using @Html.React:

Warning: React attempted to reuse markup in a container but the checksum was invalid.
This generally means that you are using server rendering and the markup generated on the
server was not what the client was expecting. React injected new markup to compensate which
works but you have lost many of the benefits of server rendering. Instead, figure out why the
markup being generated is different on the client or server:
(client) <div data-reactroot="" data-reactid
(server) <div data-reactid=".1hrhaz20mio"

When I downgrade to React 0.14.x, this is resolved.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#252

@Daniel15 Daniel15 closed this in 5062b4e Apr 12, 2016
@rnjailamba

Thanks for this , it solved my issue.

@dgpedro
dgpedro commented Nov 8, 2016

I got a question... If react 15 no longer needs the attribute data-reactid, why react.net keeps rendering elements with this attribute?

So far I was using Html.React( ... , serverOnly: true ) so the server renders nice and clean html without any of these attributes, but now I got confused if I'm doing it properly and I'm not taking advantage of server rendering at all by doing it this way!?

Could someone please clarify?

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment