File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
packages/react-property/scripts Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -64,13 +64,27 @@ const attributeToProperty = {};
6464 */
6565const attributes = [ ] ;
6666
67+ /**
68+ * `autoFocus` is predefined and excluded from `HTMLDOMPropertyConfig.js`.
69+ *
70+ * @see https://github.com/facebook/react/blob/15-stable/src/renderers/dom/shared/HTMLDOMPropertyConfig.js#L42
71+ * @see https://github.com/facebook/react/blob/15-stable/src/renderers/dom/shared/DOMProperty.js#L206
72+ */
73+ const booleanProperties = [ 'autoFocus' ] ;
74+
6775Object . keys ( DOMProperty . getPossibleStandardName ) . forEach ( attributeName => {
6876 const propertyName = DOMProperty . getPossibleStandardName [ attributeName ] ;
6977
7078 if ( attributeName !== propertyName ) {
7179 attributeToProperty [ attributeName ] = propertyName ;
7280 }
7381
82+ const property = DOMProperty . properties [ propertyName ] ;
83+
84+ if ( property && property . hasBooleanValue ) {
85+ booleanProperties . push ( propertyName ) ;
86+ }
87+
7488 attributes . push ( attributeName ) ;
7589} ) ;
7690
@@ -83,3 +97,8 @@ fs.writeFileSync(
8397 path . resolve ( HTML_DIR , 'attribute-to-property.json' ) ,
8498 JSON . stringify ( attributeToProperty )
8599) ;
100+
101+ fs . writeFileSync (
102+ path . resolve ( HTML_DIR , 'boolean-properties.json' ) ,
103+ JSON . stringify ( booleanProperties )
104+ ) ;
You can’t perform that action at this time.
0 commit comments