From c1459d7b21e11a409f0d226d91ff66016a527942 Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Tue, 19 Mar 2019 10:32:59 -0700 Subject: [PATCH] Remove '!important' check from setValueForStyles '!important' styles are no longer used internally and are not supported in the public API. --- .../src/vendor/react-dom/setValueForStyles/index.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/packages/react-native-web/src/vendor/react-dom/setValueForStyles/index.js b/packages/react-native-web/src/vendor/react-dom/setValueForStyles/index.js index f6caedc1..c41e8afe 100644 --- a/packages/react-native-web/src/vendor/react-dom/setValueForStyles/index.js +++ b/packages/react-native-web/src/vendor/react-dom/setValueForStyles/index.js @@ -28,8 +28,6 @@ function setValueForStyles(node, styles, getStack) { continue; } const isCustomProperty = styleName.indexOf('--') === 0; - const isImportant = - typeof styles[styleName] === 'string' && styles[styleName].indexOf('!important') > -1; if (process.env.NODE_ENV !== 'production') { if (!isCustomProperty) { warnValidStyle(styleName, styles[styleName], getStack); @@ -39,14 +37,9 @@ function setValueForStyles(node, styles, getStack) { if (styleName === 'float') { styleName = 'cssFloat'; } - if (isCustomProperty || isImportant) { + if (isCustomProperty) { const name = isCustomProperty ? styleName : hyphenateStyleName(styleName); - if (isImportant) { - const [value, priority] = styleValue.split('!'); - style.setProperty(name, value, priority); - } else { - style.setProperty(name, styleValue); - } + style.setProperty(name, styleValue); } else { style[styleName] = styleValue; }