Skip to content

Commit 25828d5

Browse files
refactor(attributes-to-props): update react-property to 1.0.0
1 parent 3f857bb commit 25828d5

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/attributes-to-props.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ var utilities = require('./utilities');
44

55
var camelCase = utilities.camelCase;
66

7-
var HTMLDOMPropertyConfig = reactProperty.HTMLDOMPropertyConfig;
8-
var SVGDOMPropertyConfig = reactProperty.SVGDOMPropertyConfig;
7+
var htmlProperties = reactProperty.html;
8+
var svgProperties = reactProperty.svg;
99
var isCustomAttribute = reactProperty.isCustomAttribute;
1010

1111
var hasOwnProperty = Object.prototype.hasOwnProperty;
@@ -36,8 +36,8 @@ function attributesToProps(attributes) {
3636

3737
// convert HTML attribute to React prop
3838
attributeNameLowerCased = attributeName.toLowerCase();
39-
if (hasOwnProperty.call(HTMLDOMPropertyConfig, attributeNameLowerCased)) {
40-
property = HTMLDOMPropertyConfig[attributeNameLowerCased];
39+
if (hasOwnProperty.call(htmlProperties, attributeNameLowerCased)) {
40+
property = htmlProperties[attributeNameLowerCased];
4141
props[property.propertyName] =
4242
property.hasBooleanValue ||
4343
(property.hasOverloadedBooleanValue && !attributeValue)
@@ -47,8 +47,8 @@ function attributesToProps(attributes) {
4747
}
4848

4949
// convert SVG attribute to React prop
50-
if (hasOwnProperty.call(SVGDOMPropertyConfig, attributeName)) {
51-
property = SVGDOMPropertyConfig[attributeName];
50+
if (hasOwnProperty.call(svgProperties, attributeName)) {
51+
property = svgProperties[attributeName];
5252
props[property.propertyName] = attributeValue;
5353
continue;
5454
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"dependencies": {
3838
"@types/domhandler": "2.4.1",
3939
"html-dom-parser": "0.2.2",
40-
"react-property": "0.1.0",
40+
"react-property": "1.0.0",
4141
"style-to-object": "0.2.3"
4242
},
4343
"devDependencies": {

0 commit comments

Comments
 (0)