Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

React 16 warning #1

Closed
tizmagik opened this issue Oct 9, 2017 · 5 comments
Closed

React 16 warning #1

tizmagik opened this issue Oct 9, 2017 · 5 comments

Comments

@tizmagik
Copy link
Owner

tizmagik commented Oct 9, 2017

Figure out why React 16 shows this warning:

Warning: Expected server HTML to contain a matching <title> in <div>.

You can see this in action with the example app:

npm run build
cd example
npm install
npm start

Then navigate to http://localhost:3000

@coymeetsworld
Copy link

I'll take a look

@adamgruber
Copy link

A quick look shows this might be an issue with using portals to render content outside of the root element. When React hydrates the DOM, it looks for a matching element in the server HTML but in this case can't find a <title> tag inside the root element so it throws a warning. Not sure this is fixable since this is the behavior you are going for.

@tizmagik
Copy link
Owner Author

tizmagik commented Oct 9, 2017

Heh yea, this might be a use of React Portals in a way it wasn't intended to be used. But the use case feels legit! I'm hoping it's just a false negative warning or something.

Will try and get @gaearon 's attention sometime to see if this is legit or a hacky use of Portals that he recommends against. 😁

@gaearon
Copy link

gaearon commented Oct 9, 2017

File an issue in React with an isolated small example please.

@tizmagik
Copy link
Owner Author

Filed facebook/react#11169

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

No branches or pull requests

4 participants