-
Notifications
You must be signed in to change notification settings - Fork 50.6k
Description
I have recently adapted my app to use server-side rendered markup and then reconciliate it with the client to increase loading speeds.
React correctly recognizes the rendered markup and doesn't actually touch the dom on the first rendering step.
However, when I interact(clicking, dragging, etc) with any server-side rendered react components I get the following error:
Invariant Violation: findComponentRoot .... Try inspecting the child nodes of the element with React ID ``
I understand this is a side-effect of dom mutation, however no such mutation has occured in the react element container.
Altering the state programatically(as opposed to interacting with clicks etc) does not cause these errors.
Here is the server-side rendered markup:
<div class="viewport" data-reactid=".0" data-react-checksum="-1591792822">
<div class="login-view" data-reactid=".0.0">
<div class="wrapper" data-reactid=".0.0.0">
<img src="images/logo.png" class="logo" width="150" height="164" data-reactid=".0.0.0.0">
<div class="form" data-reactid=".0.0.0.1">
<div class="input-container username" data-reactid=".0.0.0.1.0">
<div class="label username-label icon ss-standard ss-user" data-reactid=".0.0.0.1.0.0">
</div>
<input class="username" type="email" name="username" placeholder="Email" value="" data-reactid=".0.0.0.1.0.1">
</div>
<div class="input-container password" data-reactid=".0.0.0.1.1">
<div class="label password-label icon ss-standard ss-lock" data-reactid=".0.0.0.1.1.0">
</div>
<input class="password" type="password" name="password" placeholder="Password" value="" data-reactid=".0.0.0.1.1.1">
</div>
<button class="button login" data-reactid=".0.0.0.1.2">
Login
</button>
</div>
</div>
<img src="images/waves.png" class="waves" width="1366" height="94" data-reactid=".0.0.1">
</div>
<div class="app hide" data-reactid=".0.1">
<div class="sidebar phone" data-reactid=".0.1.0">
<div class="categories" data-reactid=".0.1.0.0">
<div class="categories-header" data-reactid=".0.1.0.0.0">
<div class="text" data-reactid=".0.1.0.0.0.0">
Categories
</div>
<div class="arrow ss-standard ss-navigatedown" data-reactid=".0.1.0.0.0.1">
</div>
</div>
<div class="categories-scroller" data-reactid=".0.1.0.0.1">
<div class="categories-wrapper" data-reactid=".0.1.0.0.1.0">
</div>
</div>
</div>
<div class="add-category" data-reactid=".0.1.0.1">
<div class="icon ss-standard ss-plus" data-reactid=".0.1.0.1.0">
</div>
<div class="text" data-reactid=".0.1.0.1.1">
Add Category
</div>
</div>
<div class="bottom-menu" data-reactid=".0.1.0.2">
<div class="settings" data-reactid=".0.1.0.2.1">
<div class="icon ss-standard ss-settings" data-reactid=".0.1.0.2.1.0">
</div>
<div class="text" data-reactid=".0.1.0.2.1.1">
SETTINGS
</div>
</div>
<div class="minimize" data-reactid=".0.1.0.2.2">
<div class="icon ss-standard ss-navigateright" data-reactid=".0.1.0.2.2.0">
</div>
</div>
</div>
</div>
<div class="columns" data-reactid=".0.1.1">
<span data-reactid=".0.1.1.0">
</span>
</div>
</div>
</div>I am calling renderComponent on the client, on the dom node that contains that server-rendered markup.
E.g
viewportElement = document.getElementById("viewport-element")
React.render(<Viewport />, viewportElement)Thanks for creating and maintaining this amazing UI framework!