8
*/
9
10
// TODO: direct imports like some-package/src/* are bad. Fix me.
11
-import ReactDebugCurrentFiber from 'react-reconciler/src/ReactDebugCurrentFiber';
11
+import {
12
+ getCurrentFiberOwnerNameInDevOrNull,
13
+ getCurrentFiberStackInDevOrNull,
14
+} from 'react-reconciler/src/ReactCurrentFiber';
15
import {registrationNameModules} from 'events/EventPluginRegistry';
16
import warning from 'shared/warning';
17
48
import {validateProperties as validateInputProperties} from '../shared/ReactDOMNullInputValuePropHook';
49
import {validateProperties as validateUnknownProperties} from '../shared/ReactDOMUnknownPropertyHook';
50
48
-const {
49
- getCurrentFiberOwnerName,
50
- getCurrentFiberStackAddendum,
51
-} = ReactDebugCurrentFiber;
51
let didWarnInvalidHydration = false;
52
let didWarnShadyDOM = false;
53
61
62
const {html: HTML_NAMESPACE} = Namespaces;
63
65
-let getStack = () => '';
64
+let getStackInDevOrNull = () => '';
65
66
let warnedUnknownTags;
67
let suppressHydrationWarning;
76
let normalizeHTML;
77
78
if (__DEV__) {
80
- getStack = getCurrentFiberStackAddendum;
79
+ getStackInDevOrNull = getCurrentFiberStackInDevOrNull;
80
81
warnedUnknownTags = {
82
// Chrome is the only major browser not shipping <time>. But as of July
180
registrationName,
181
registrationName,
182
registrationName,
184
- getCurrentFiberStackAddendum(),
183
+ getCurrentFiberStackInDevOrNull(),
184
);
185
} else {
186
warning(
188
'Expected `%s` listener to be a function, instead got a value of `%s` type.%s',
189
registrationName,
190
typeof listener,
192
- getCurrentFiberStackAddendum(),
191
+ getCurrentFiberStackInDevOrNull(),
192
);
193
}
194
};
266
}
267
}
268
// Relies on `updateStylesByID` not mutating `styleUpdates`.
270
- CSSPropertyOperations.setValueForStyles(domElement, nextProp, getStack);
269
+ CSSPropertyOperations.setValueForStyles(
270
+ domElement,
271
+ nextProp,
272
+ getStackInDevOrNull,
273
+ );
274
} else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
275
const nextHtml = nextProp ? nextProp[HTML] : undefined;
276
if (nextHtml != null) {
326
const propKey = updatePayload[i];
327
const propValue = updatePayload[i + 1];
328
if (propKey === STYLE) {
326
- CSSPropertyOperations.setValueForStyles(domElement, propValue, getStack);
329
+ CSSPropertyOperations.setValueForStyles(
330
+ domElement,
331
+ propValue,
332
+ getStackInDevOrNull,
333
+ );
334
} else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
335
setInnerHTML(domElement, propValue);
336
} else if (propKey === CHILDREN) {
449
false,
450
'%s is using shady DOM. Using shady DOM with React can ' +
451
'cause things to break subtly.',
445
- getCurrentFiberOwnerName() || 'A component',
452
+ getCurrentFiberOwnerNameInDevOrNull() || 'A component',
453
);
454
didWarnShadyDOM = true;
455
}
523
props = rawProps;
524
}
525
519
- assertValidProps(tag, props, getStack);
526
+ assertValidProps(tag, props, getStackInDevOrNull);
527
528
setInitialDOMProperties(
529
tag,
611
break;
612
}
613
607
- assertValidProps(tag, nextProps, getStack);
614
+ assertValidProps(tag, nextProps, getStackInDevOrNull);
615
616
let propKey;
617
let styleName;
841
false,
842
'%s is using shady DOM. Using shady DOM with React can ' +
843
'cause things to break subtly.',
837
- getCurrentFiberOwnerName() || 'A component',
844
+ getCurrentFiberOwnerNameInDevOrNull() || 'A component',
845
);
846
didWarnShadyDOM = true;
847
}
902
break;
903
}
904
898
- assertValidProps(tag, rawProps, getStack);
905
+ assertValidProps(tag, rawProps, getStackInDevOrNull);
906
907
if (__DEV__) {
908
extraAttributeNames = new Set();