Skip to content

Commit

Permalink
Remove unitless number whitelist
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp-spiess committed Sep 5, 2018
1 parent 4e744be commit b6edcfc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 84 deletions.
80 changes: 0 additions & 80 deletions packages/react-dom/src/shared/CSSProperty.js

This file was deleted.

5 changes: 1 addition & 4 deletions packages/react-dom/src/shared/dangerousStyleValue.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* LICENSE file in the root directory of this source tree.
*/

import {isUnitlessNumber} from './CSSProperty';

/**
* Convert a value into the proper css writable value. The style name `name`
* should be logical (no hyphens), as specified
Expand Down Expand Up @@ -35,8 +33,7 @@ function dangerousStyleValue(name, value, isCustomProperty) {
if (
!isCustomProperty &&
typeof value === 'number' &&
value !== 0 &&
!(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])
value !== 0
) {
return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers
}
Expand Down

0 comments on commit b6edcfc

Please sign in to comment.