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
Prev

Simpler fix

  • Loading branch information...
gaearon committed Jul 26, 2019
commit 071824ceb28baa173985cce8c4802f6f6550a961
@@ -208,11 +208,11 @@ function validateDangerousTag(tag) {
}

const styleNameCache = {};
const processStyleName = function(styleName, isCustomProperty) {
const processStyleName = function(styleName) {
if (styleNameCache.hasOwnProperty(styleName)) {
return styleNameCache[styleName];
}
const result = isCustomProperty ? styleName : hyphenateStyleName(styleName);
const result = hyphenateStyleName(styleName);
styleNameCache[styleName] = result;
return result;
};
@@ -233,7 +233,9 @@ function createMarkupForStyles(styles): string | null {
}
if (styleValue != null) {
serialized +=
delimiter + processStyleName(styleName, isCustomProperty) + ':';
delimiter +
(isCustomProperty ? styleName : processStyleName(styleName)) +
':';
serialized += dangerousStyleValue(
styleName,
styleValue,
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.