File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ /**
4
+ * Module dependencies.
5
+ */
6
+ var HTMLDOMPropertyConfig = require ( 'react/lib/HTMLDOMPropertyConfig' ) ;
7
+ var utilities = require ( './utilities' ) ;
8
+
9
+ // first map out the DOM attribute names
10
+ // e.g., { className: 'class' } => { class: 'className' }
11
+ // https://github.com/facebook/react/blob/master/src/renderers/dom/shared/HTMLDOMPropertyConfig.js#L204
12
+ var config = utilities . invertObject (
13
+ HTMLDOMPropertyConfig . DOMAttributeNames
14
+ ) ;
15
+
16
+ // then map out the rest of the DOM properties
17
+ // e.g., { charSet: 0 } => { charset: 'charSet' }
18
+ // https://github.com/facebook/react/blob/master/src/renderers/dom/shared/HTMLDOMPropertyConfig.js#L28
19
+ for ( var key in HTMLDOMPropertyConfig . Properties ) {
20
+ config [ key . toLowerCase ( ) ] = key ;
21
+ }
22
+
23
+ /**
24
+ * Export React property config.
25
+ */
26
+ module . exports = config ;
You can’t perform that action at this time.
0 commit comments