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

Wrong SSR diff warning due to non lowercase attributes #10672

Closed
paradoxxxzero opened this issue Sep 11, 2017 · 4 comments
Closed

Wrong SSR diff warning due to non lowercase attributes #10672

paradoxxxzero opened this issue Sep 11, 2017 · 4 comments
Milestone

Comments

@paradoxxxzero
Copy link

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

What is the current behavior?
I got this warning: Warning: Extra attributes from the server: preserveAspectRatio,viewBox during client side hydratation when my react tree contains mixed case attributes such as these svg ones.

What is the expected behavior?

No warnings because there are no difference between server and client attributes.

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

React 16.0.0-rc.2
This worked on 15.*

This seems to happen because the attribute name is put to lowercase here:

var name = attributes[i].name.toLowerCase();

but not in the set here:
extraAttributeNames.add(attributes[i].name);

As the set removal is done with the lowercased attribute:
extraAttributeNames.delete(propKey.toLowerCase());

it stays in the extraAttributeNames set and I got wrongly the previous warning.

@gaearon
Copy link
Collaborator

gaearon commented Sep 11, 2017

Can you provide a full reproducing example?

@gaearon
Copy link
Collaborator

gaearon commented Sep 11, 2017

I have a fix in #10676.

@gaearon
Copy link
Collaborator

gaearon commented Sep 14, 2017

I released 16.0.0-rc.3 that should fix this. Can you please verify?

@paradoxxxzero
Copy link
Author

All good! Cheers

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

No branches or pull requests

2 participants