File tree Expand file tree Collapse file tree 3 files changed +24
-34
lines changed Expand file tree Collapse file tree 3 files changed +24
-34
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 33/**
44 * Module dependencies.
55 */
6- var HTMLDOMPropertyConfig = require ( './DOMPropertyConfig' ) . HTMLDOMPropertyConfig ;
76var utilities = require ( './utilities' ) ;
87var propertyConfig = require ( './property-config' ) ;
8+ var config = propertyConfig . config ;
9+ var isCustomAttribute = propertyConfig . HTMLDOMPropertyConfig . isCustomAttribute ;
910
1011/**
1112 * Make attributes compatible with React props.
@@ -24,20 +25,20 @@ function attributesToProps(attributes) {
2425 propertyValue = attributes [ propertyName ] ;
2526
2627 // custom attributes (`data-` and `aria-`)
27- if ( HTMLDOMPropertyConfig . isCustomAttribute ( propertyName ) ) {
28+ if ( isCustomAttribute ( propertyName ) ) {
2829 props [ propertyName ] = propertyValue ;
2930 continue ;
3031 }
3132
3233 // make HTML DOM attribute/property consistent with React attribute/property
33- reactProperty = propertyConfig . html [ propertyName . toLowerCase ( ) ] ;
34+ reactProperty = config . html [ propertyName . toLowerCase ( ) ] ;
3435 if ( reactProperty ) {
3536 props [ reactProperty ] = propertyValue ;
3637 continue ;
3738 }
3839
3940 // make SVG DOM attribute/property consistent with React attribute/property
40- reactProperty = propertyConfig . svg [ propertyName ] ;
41+ reactProperty = config . svg [ propertyName ] ;
4142 if ( reactProperty ) {
4243 props [ reactProperty ] = propertyValue ;
4344 }
Original file line number Diff line number Diff line change 44 * Module dependencies.
55 */
66var utilities = require ( './utilities' ) ;
7- var DOMPropertyConfig = require ( './DOMPropertyConfig' ) ;
8- var HTMLDOMPropertyConfig = DOMPropertyConfig . HTMLDOMPropertyConfig ;
9- var SVGDOMPropertyConfig = DOMPropertyConfig . SVGDOMPropertyConfig ;
7+
8+ // HTML and SVG DOM Property Configs
9+ // originally in `react/lib/` but moved to `react-dom/lib/` in 15.4
10+ var HTMLDOMPropertyConfig ;
11+ var SVGDOMPropertyConfig ;
12+
13+ try {
14+ HTMLDOMPropertyConfig = require ( 'react-dom/lib/HTMLDOMPropertyConfig' ) ;
15+ SVGDOMPropertyConfig = require ( 'react-dom/lib/SVGDOMPropertyConfig' ) ;
16+ } catch ( error ) {
17+ HTMLDOMPropertyConfig = require ( 'react/lib/HTMLDOMPropertyConfig' ) ;
18+ SVGDOMPropertyConfig = require ( 'react/lib/SVGDOMPropertyConfig' ) ;
19+ }
1020
1121var config = {
1222 html : { } ,
@@ -54,6 +64,10 @@ for (propertyName in SVGDOMPropertyConfig.Properties) {
5464}
5565
5666/**
57- * Export React property config .
67+ * Export React property configs .
5868 */
59- module . exports = config ;
69+ module . exports = {
70+ config : config ,
71+ HTMLDOMPropertyConfig : HTMLDOMPropertyConfig ,
72+ SVGDOMPropertyConfig : SVGDOMPropertyConfig
73+ } ;
You can’t perform that action at this time.
0 commit comments