Navigation Menu

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

Don't hyphenate custom CSS properties for ReactDOMServer #16167

Merged
merged 8 commits into from Jul 26, 2019

Conversation

bedakb
Copy link
Contributor

@bedakb bedakb commented Jul 20, 2019

This PR fixes #16160

@bedakb bedakb changed the title Don't hyphenate custom CSS properties Don't hyphenate custom CSS properties for ReactDOMServer Jul 20, 2019
@sizebot
Copy link

sizebot commented Jul 20, 2019

No significant bundle size changes to report.

Generated by 🚫 dangerJS

@gaearon
Copy link
Collaborator

gaearon commented Jul 20, 2019

Please add a test to one of ReactDOMServerIntegration files. This will likely uncover that we still emit an incorrect warning. To fix the warning I think you'll need to make a similar fix here.

@bedakb
Copy link
Contributor Author

bedakb commented Jul 20, 2019

@gaearon updated.
Hope It looks ok.

@@ -212,7 +212,8 @@ const processStyleName = function(styleName) {
if (styleNameCache.hasOwnProperty(styleName)) {
return styleNameCache[styleName];
}
const result = hyphenateStyleName(styleName);
const isCustomProperty = styleName.indexOf('--') === 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not ideal that we do this check again because createMarkupForStyles which calls us already does the same check anyway.

@gaearon gaearon merged commit 858c842 into facebook:master Jul 26, 2019
@gaearon
Copy link
Collaborator

gaearon commented Jul 26, 2019

Looks good to me. Thanks.

This was referenced Mar 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: React DOM Server is mutating CSS variable names
5 participants