|
7 | 7 | * @flow
|
8 | 8 | */
|
9 | 9 |
|
10 |
| -import {enableCustomElementPropertySupport} from 'shared/ReactFeatureFlags'; |
11 | 10 | import hasOwnProperty from 'shared/hasOwnProperty';
|
12 | 11 |
|
13 | 12 | type PropertyType = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
14 | 13 |
|
15 |
| -// A reserved attribute. |
16 |
| -// It is handled by React separately and shouldn't be written to the DOM. |
17 |
| -export const RESERVED = 0; |
18 |
| - |
19 | 14 | // A simple string attribute.
|
20 | 15 | // Attributes that aren't in the filter are presumed to have this type.
|
21 | 16 | export const STRING = 1;
|
@@ -120,37 +115,6 @@ function PropertyInfoRecord(
|
120 | 115 | // name warnings.
|
121 | 116 | const properties: {[string]: $FlowFixMe} = {};
|
122 | 117 |
|
123 |
| -// These props are reserved by React. They shouldn't be written to the DOM. |
124 |
| -const reservedProps = [ |
125 |
| - 'children', |
126 |
| - 'dangerouslySetInnerHTML', |
127 |
| - // TODO: This prevents the assignment of defaultValue to regular |
128 |
| - // elements (not just inputs). Now that ReactDOMInput assigns to the |
129 |
| - // defaultValue property -- do we need this? |
130 |
| - 'defaultValue', |
131 |
| - 'defaultChecked', |
132 |
| - 'innerHTML', |
133 |
| - 'suppressContentEditableWarning', |
134 |
| - 'suppressHydrationWarning', |
135 |
| - 'style', |
136 |
| -]; |
137 |
| -if (enableCustomElementPropertySupport) { |
138 |
| - reservedProps.push('innerText', 'textContent'); |
139 |
| -} |
140 |
| - |
141 |
| -reservedProps.forEach(name => { |
142 |
| - // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions |
143 |
| - properties[name] = new PropertyInfoRecord( |
144 |
| - name, |
145 |
| - RESERVED, |
146 |
| - false, // mustUseProperty |
147 |
| - name, // attributeName |
148 |
| - null, // attributeNamespace |
149 |
| - false, // sanitizeURL |
150 |
| - false, // removeEmptyString |
151 |
| - ); |
152 |
| -}); |
153 |
| - |
154 | 118 | // A few React string attributes have a different name.
|
155 | 119 | // This is a mapping from React prop names to the attribute names.
|
156 | 120 | [
|
|
0 commit comments