Skip to content

[16.0.0-alpha.12] ReactDOM removes server rendered content before rendering it again #10405

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
siddharthkp opened this issue Aug 8, 2017 · 2 comments

Comments

@siddharthkp
Copy link

siddharthkp commented Aug 8, 2017

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
In React 16, ReactDOM removes server rendered content before rendering it again. (tested on 16.0.0-alpha.12). For applications with a big component tree, this is perceivable by the user.

**If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

I have reproduced the bug here.

Tiny app:

  1. There's a box component which is rendered on the server with renderToString and sent to the
    client.
  2. The client loads bundle.js which contains the same component.

I have a added debugger in componentWillMount for the box component to show this
(open your dev tools)

React 15.6.1: https://recon-15.now.sh/
React 16.0.0-alpha.12: https://recon-16.now.sh/

Code is here: https://github.com/siddharthkp/react-16-reconciliation-bug

What is the expected behavior?
ReactDOM should perform reconciliation without removing content. (React 15 had this behavior)

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

Browser: Chrome
Current version: 16.0.0-alpha.12
Previous version: 15.6.1

@gaearon
Copy link
Collaborator

gaearon commented Aug 8, 2017

Can you please try 16.0.0-beta.3? We generally don’t support alpha versions (except for React Native) so it’s expected for them to have many bugs.

@siddharthkp
Copy link
Author

siddharthkp commented Aug 8, 2017

@Gaeron, Thanks! It works with 16.0.0-beta.3.

Sorry for wasting your time.

Do you think it makes sense to change the installation instructions in #10294 which was shared on the react/blog.

next points to 16.0.0-alpha.12 right now.

Update:

Looks like next points to 16.0.0-beta.3. Not sure how I ended up on alpha. My bad!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants