react 0.0.0-f9e41e3a5 → 0.0.0-fb28e9048
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build-info.json +5 -5
- package/cjs/react.development.js +357 -87
- package/cjs/react.production.min.js +16 -17
- package/package.json +2 -2
- package/umd/react.development.js +686 -438
- package/umd/react.production.min.js +25 -26
- package/umd/react.profiling.min.js +29 -30
package/build-info.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"branch": "
|
|
3
|
-
"buildNumber": "
|
|
4
|
-
"checksum": "
|
|
5
|
-
"commit": "
|
|
2
|
+
"branch": "master",
|
|
3
|
+
"buildNumber": "14570",
|
|
4
|
+
"checksum": "570e68b",
|
|
5
|
+
"commit": "fb28e9048",
|
|
6
6
|
"environment": "ci",
|
|
7
|
-
"reactVersion": "16.8.
|
|
7
|
+
"reactVersion": "16.8.6-canary-fb28e9048"
|
|
8
8
|
}
|
package/cjs/react.development.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v0.0.0-
|
|
1
|
+
/** @license React v0.0.0-fb28e9048
|
|
2
2
|
* react.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -20,7 +20,7 @@ var checkPropTypes = require('prop-types/checkPropTypes');
|
|
|
20
20
|
|
|
21
21
|
// TODO: this is special because it gets imported during build.
|
|
22
22
|
|
|
23
|
-
var ReactVersion = '16.8.
|
|
23
|
+
var ReactVersion = '16.8.6-canary-fb28e9048';
|
|
24
24
|
|
|
25
25
|
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
26
26
|
// nor polyfill, then a plain number is used for performance.
|
|
@@ -39,6 +39,13 @@ var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead
|
|
|
39
39
|
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
40
40
|
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
41
41
|
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
42
|
+
var REACT_EVENT_COMPONENT_TYPE = hasSymbol ? Symbol.for('react.event_component') : 0xead5;
|
|
43
|
+
var REACT_EVENT_TARGET_TYPE = hasSymbol ? Symbol.for('react.event_target') : 0xead6;
|
|
44
|
+
|
|
45
|
+
// React event targets
|
|
46
|
+
var REACT_EVENT_TARGET_TOUCH_HIT = hasSymbol ? Symbol.for('react.event_target.touch_hit') : 0xead7;
|
|
47
|
+
var REACT_EVENT_FOCUS_TARGET = hasSymbol ? Symbol.for('react.event_target.focus') : 0xead8;
|
|
48
|
+
var REACT_EVENT_PRESS_TARGET = hasSymbol ? Symbol.for('react.event_target.press') : 0xead9;
|
|
42
49
|
|
|
43
50
|
var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
44
51
|
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
|
@@ -54,6 +61,20 @@ function getIteratorFn(maybeIterable) {
|
|
|
54
61
|
return null;
|
|
55
62
|
}
|
|
56
63
|
|
|
64
|
+
// Do not require this module directly! Use a normal error constructor with
|
|
65
|
+
// template literal strings. The messages will be converted to ReactError during
|
|
66
|
+
// build, and in production they will be minified.
|
|
67
|
+
|
|
68
|
+
// Do not require this module directly! Use a normal error constructor with
|
|
69
|
+
// template literal strings. The messages will be converted to ReactError during
|
|
70
|
+
// build, and in production they will be minified.
|
|
71
|
+
|
|
72
|
+
function ReactError(message) {
|
|
73
|
+
var error = new Error(message);
|
|
74
|
+
error.name = 'Invariant Violation';
|
|
75
|
+
return error;
|
|
76
|
+
}
|
|
77
|
+
|
|
57
78
|
/**
|
|
58
79
|
* Use invariant() to assert state which your program assumes to be true.
|
|
59
80
|
*
|
|
@@ -65,40 +86,6 @@ function getIteratorFn(maybeIterable) {
|
|
|
65
86
|
* will remain to ensure logic does not differ in production.
|
|
66
87
|
*/
|
|
67
88
|
|
|
68
|
-
var validateFormat = function () {};
|
|
69
|
-
|
|
70
|
-
{
|
|
71
|
-
validateFormat = function (format) {
|
|
72
|
-
if (format === undefined) {
|
|
73
|
-
throw new Error('invariant requires an error message argument');
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function invariant(condition, format, a, b, c, d, e, f) {
|
|
79
|
-
validateFormat(format);
|
|
80
|
-
|
|
81
|
-
if (!condition) {
|
|
82
|
-
var error = void 0;
|
|
83
|
-
if (format === undefined) {
|
|
84
|
-
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
|
85
|
-
} else {
|
|
86
|
-
var args = [a, b, c, d, e, f];
|
|
87
|
-
var argIndex = 0;
|
|
88
|
-
error = new Error(format.replace(/%s/g, function () {
|
|
89
|
-
return args[argIndex++];
|
|
90
|
-
}));
|
|
91
|
-
error.name = 'Invariant Violation';
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
error.framesToPop = 1; // we don't care about invariant's own frame
|
|
95
|
-
throw error;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// Relying on the `invariant()` implementation lets us
|
|
100
|
-
// preserve the format and params in the www builds.
|
|
101
|
-
|
|
102
89
|
/**
|
|
103
90
|
* Forked from fbjs/warning:
|
|
104
91
|
* https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
|
|
@@ -331,7 +318,13 @@ Component.prototype.isReactComponent = {};
|
|
|
331
318
|
* @protected
|
|
332
319
|
*/
|
|
333
320
|
Component.prototype.setState = function (partialState, callback) {
|
|
334
|
-
|
|
321
|
+
(function () {
|
|
322
|
+
if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) {
|
|
323
|
+
{
|
|
324
|
+
throw ReactError('setState(...): takes an object of state variables to update or a function which returns an object of state variables.');
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
})();
|
|
335
328
|
this.updater.enqueueSetState(this, partialState, callback, 'setState');
|
|
336
329
|
};
|
|
337
330
|
|
|
@@ -469,6 +462,63 @@ function refineResolvedLazyComponent(lazyComponent) {
|
|
|
469
462
|
return lazyComponent._status === Resolved ? lazyComponent._result : null;
|
|
470
463
|
}
|
|
471
464
|
|
|
465
|
+
// Helps identify side effects in begin-phase lifecycle hooks and setState reducers:
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
// In some cases, StrictMode should also double-render lifecycles.
|
|
469
|
+
// This can be confusing for tests though,
|
|
470
|
+
// And it can be bad for performance in production.
|
|
471
|
+
// This feature flag can be used to control the behavior:
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
// To preserve the "Pause on caught exceptions" behavior of the debugger, we
|
|
475
|
+
// replay the begin phase of a failed component inside invokeGuardedCallback.
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
// Gather advanced timing metrics for Profiler subtrees.
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
// Trace which interactions trigger each commit.
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
// Only used in www builds.
|
|
488
|
+
// TODO: true? Here it might just be false.
|
|
489
|
+
|
|
490
|
+
// Only used in www builds.
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
// Only used in www builds.
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
// Disable javascript: URL strings in href for XSS protection.
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
// Disables yielding during render in Concurrent Mode. Used for debugging only.
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
// React Fire: prevent the value and checked attributes from syncing
|
|
503
|
+
// with their related DOM properties
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
// These APIs will no longer be "unstable" in the upcoming 16.7 release,
|
|
507
|
+
// Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
|
|
508
|
+
var enableStableConcurrentModeAPIs = false;
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
// See https://github.com/react-native-community/discussions-and-proposals/issues/72 for more information
|
|
513
|
+
// This is a flag so we can fix warnings in RN core before turning it on
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
// Experimental React Events support. Only used in www builds for now.
|
|
517
|
+
var enableEventAPI = false;
|
|
518
|
+
|
|
519
|
+
// New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107
|
|
520
|
+
var enableJSXTransformAPI = false;
|
|
521
|
+
|
|
472
522
|
function getWrappedName(outerType, innerType, wrapperName) {
|
|
473
523
|
var functionName = innerType.displayName || innerType.name || '';
|
|
474
524
|
return outerType.displayName || (functionName !== '' ? wrapperName + '(' + functionName + ')' : wrapperName);
|
|
@@ -521,6 +571,35 @@ function getComponentName(type) {
|
|
|
521
571
|
if (resolvedThenable) {
|
|
522
572
|
return getComponentName(resolvedThenable);
|
|
523
573
|
}
|
|
574
|
+
break;
|
|
575
|
+
}
|
|
576
|
+
case REACT_EVENT_COMPONENT_TYPE:
|
|
577
|
+
{
|
|
578
|
+
if (enableEventAPI) {
|
|
579
|
+
var eventComponent = type;
|
|
580
|
+
var displayName = eventComponent.displayName;
|
|
581
|
+
if (displayName !== undefined) {
|
|
582
|
+
return displayName;
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
break;
|
|
586
|
+
}
|
|
587
|
+
case REACT_EVENT_TARGET_TYPE:
|
|
588
|
+
{
|
|
589
|
+
if (enableEventAPI) {
|
|
590
|
+
var eventTarget = type;
|
|
591
|
+
if (eventTarget.type === REACT_EVENT_TARGET_TOUCH_HIT) {
|
|
592
|
+
return 'TouchHitTarget';
|
|
593
|
+
} else if (eventTarget.type === REACT_EVENT_FOCUS_TARGET) {
|
|
594
|
+
return 'FocusTarget';
|
|
595
|
+
} else if (eventTarget.type === REACT_EVENT_PRESS_TARGET) {
|
|
596
|
+
return 'PressTarget';
|
|
597
|
+
}
|
|
598
|
+
var _displayName = eventTarget.displayName;
|
|
599
|
+
if (_displayName !== undefined) {
|
|
600
|
+
return _displayName;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
524
603
|
}
|
|
525
604
|
}
|
|
526
605
|
}
|
|
@@ -564,6 +643,8 @@ function setCurrentlyValidatingElement(element) {
|
|
|
564
643
|
var ReactSharedInternals = {
|
|
565
644
|
ReactCurrentDispatcher: ReactCurrentDispatcher,
|
|
566
645
|
ReactCurrentOwner: ReactCurrentOwner,
|
|
646
|
+
// used by act()
|
|
647
|
+
ReactShouldWarnActingUpdates: { current: false },
|
|
567
648
|
// Used by renderers to avoid bundling object-assign twice in UMD bundles:
|
|
568
649
|
assign: _assign
|
|
569
650
|
};
|
|
@@ -677,8 +758,10 @@ function defineRefPropWarningGetter(props, displayName) {
|
|
|
677
758
|
* if something is a React Element.
|
|
678
759
|
*
|
|
679
760
|
* @param {*} type
|
|
761
|
+
* @param {*} props
|
|
680
762
|
* @param {*} key
|
|
681
763
|
* @param {string|object} ref
|
|
764
|
+
* @param {*} owner
|
|
682
765
|
* @param {*} self A *temporary* helper to detect places where `this` is
|
|
683
766
|
* different from the `owner` when React.createElement is called, so that we
|
|
684
767
|
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
|
@@ -686,8 +769,6 @@ function defineRefPropWarningGetter(props, displayName) {
|
|
|
686
769
|
* change in behavior.
|
|
687
770
|
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
|
688
771
|
* indicating filename, line number, and/or other information.
|
|
689
|
-
* @param {*} owner
|
|
690
|
-
* @param {*} props
|
|
691
772
|
* @internal
|
|
692
773
|
*/
|
|
693
774
|
var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
@@ -746,6 +827,73 @@ var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
|
746
827
|
return element;
|
|
747
828
|
};
|
|
748
829
|
|
|
830
|
+
/**
|
|
831
|
+
* https://github.com/reactjs/rfcs/pull/107
|
|
832
|
+
* @param {*} type
|
|
833
|
+
* @param {object} props
|
|
834
|
+
* @param {string} key
|
|
835
|
+
*/
|
|
836
|
+
|
|
837
|
+
|
|
838
|
+
/**
|
|
839
|
+
* https://github.com/reactjs/rfcs/pull/107
|
|
840
|
+
* @param {*} type
|
|
841
|
+
* @param {object} props
|
|
842
|
+
* @param {string} key
|
|
843
|
+
*/
|
|
844
|
+
function jsxDEV(type, config, maybeKey, source, self) {
|
|
845
|
+
var propName = void 0;
|
|
846
|
+
|
|
847
|
+
// Reserved names are extracted
|
|
848
|
+
var props = {};
|
|
849
|
+
|
|
850
|
+
var key = null;
|
|
851
|
+
var ref = null;
|
|
852
|
+
|
|
853
|
+
if (hasValidRef(config)) {
|
|
854
|
+
ref = config.ref;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
if (hasValidKey(config)) {
|
|
858
|
+
key = '' + config.key;
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
// Remaining properties are added to a new props object
|
|
862
|
+
for (propName in config) {
|
|
863
|
+
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
864
|
+
props[propName] = config[propName];
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
// intentionally not checking if key was set above
|
|
869
|
+
// this key is higher priority as it's static
|
|
870
|
+
if (maybeKey !== undefined) {
|
|
871
|
+
key = '' + maybeKey;
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
// Resolve default props
|
|
875
|
+
if (type && type.defaultProps) {
|
|
876
|
+
var defaultProps = type.defaultProps;
|
|
877
|
+
for (propName in defaultProps) {
|
|
878
|
+
if (props[propName] === undefined) {
|
|
879
|
+
props[propName] = defaultProps[propName];
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
if (key || ref) {
|
|
885
|
+
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
|
886
|
+
if (key) {
|
|
887
|
+
defineKeyPropWarningGetter(props, displayName);
|
|
888
|
+
}
|
|
889
|
+
if (ref) {
|
|
890
|
+
defineRefPropWarningGetter(props, displayName);
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
895
|
+
}
|
|
896
|
+
|
|
749
897
|
/**
|
|
750
898
|
* Create and return a new ReactElement of the given type.
|
|
751
899
|
* See https://reactjs.org/docs/react-api.html#createelement
|
|
@@ -837,7 +985,13 @@ function cloneAndReplaceKey(oldElement, newKey) {
|
|
|
837
985
|
* See https://reactjs.org/docs/react-api.html#cloneelement
|
|
838
986
|
*/
|
|
839
987
|
function cloneElement(element, config, children) {
|
|
840
|
-
|
|
988
|
+
(function () {
|
|
989
|
+
if (!!(element === null || element === undefined)) {
|
|
990
|
+
{
|
|
991
|
+
throw ReactError('React.cloneElement(...): The argument must be a React element, but you passed ' + element + '.');
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
})();
|
|
841
995
|
|
|
842
996
|
var propName = void 0;
|
|
843
997
|
|
|
@@ -1057,7 +1211,13 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
|
|
|
1057
1211
|
addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum();
|
|
1058
1212
|
}
|
|
1059
1213
|
var childrenString = '' + children;
|
|
1060
|
-
|
|
1214
|
+
(function () {
|
|
1215
|
+
{
|
|
1216
|
+
{
|
|
1217
|
+
throw ReactError('Objects are not valid as a React child (found: ' + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + ').' + addendum);
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
})();
|
|
1061
1221
|
}
|
|
1062
1222
|
}
|
|
1063
1223
|
|
|
@@ -1233,7 +1393,13 @@ function toArray(children) {
|
|
|
1233
1393
|
* structure.
|
|
1234
1394
|
*/
|
|
1235
1395
|
function onlyChild(children) {
|
|
1236
|
-
|
|
1396
|
+
(function () {
|
|
1397
|
+
if (!isValidElement(children)) {
|
|
1398
|
+
{
|
|
1399
|
+
throw ReactError('React.Children.only expected to receive a single React element child.');
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
})();
|
|
1237
1403
|
return children;
|
|
1238
1404
|
}
|
|
1239
1405
|
|
|
@@ -1415,7 +1581,7 @@ function forwardRef(render) {
|
|
|
1415
1581
|
function isValidElementType(type) {
|
|
1416
1582
|
return typeof type === 'string' || typeof type === 'function' ||
|
|
1417
1583
|
// Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
1418
|
-
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE);
|
|
1584
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_EVENT_COMPONENT_TYPE || type.$$typeof === REACT_EVENT_TARGET_TYPE);
|
|
1419
1585
|
}
|
|
1420
1586
|
|
|
1421
1587
|
function memo(type, compare) {
|
|
@@ -1433,7 +1599,13 @@ function memo(type, compare) {
|
|
|
1433
1599
|
|
|
1434
1600
|
function resolveDispatcher() {
|
|
1435
1601
|
var dispatcher = ReactCurrentDispatcher.current;
|
|
1436
|
-
|
|
1602
|
+
(function () {
|
|
1603
|
+
if (!(dispatcher !== null)) {
|
|
1604
|
+
{
|
|
1605
|
+
throw ReactError('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.');
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
})();
|
|
1437
1609
|
return dispatcher;
|
|
1438
1610
|
}
|
|
1439
1611
|
|
|
@@ -1527,9 +1699,8 @@ function getDeclarationErrorAddendum() {
|
|
|
1527
1699
|
return '';
|
|
1528
1700
|
}
|
|
1529
1701
|
|
|
1530
|
-
function getSourceInfoErrorAddendum(
|
|
1531
|
-
if (
|
|
1532
|
-
var source = elementProps.__source;
|
|
1702
|
+
function getSourceInfoErrorAddendum(source) {
|
|
1703
|
+
if (source !== undefined) {
|
|
1533
1704
|
var fileName = source.fileName.replace(/^.*[\\\/]/, '');
|
|
1534
1705
|
var lineNumber = source.lineNumber;
|
|
1535
1706
|
return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
|
|
@@ -1537,6 +1708,13 @@ function getSourceInfoErrorAddendum(elementProps) {
|
|
|
1537
1708
|
return '';
|
|
1538
1709
|
}
|
|
1539
1710
|
|
|
1711
|
+
function getSourceInfoErrorAddendumForProps(elementProps) {
|
|
1712
|
+
if (elementProps !== null && elementProps !== undefined) {
|
|
1713
|
+
return getSourceInfoErrorAddendum(elementProps.__source);
|
|
1714
|
+
}
|
|
1715
|
+
return '';
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1540
1718
|
/**
|
|
1541
1719
|
* Warn if there's no key explicitly set on dynamic arrays of children or
|
|
1542
1720
|
* object keys are not valid. This allows us to keep track of children between
|
|
@@ -1697,6 +1875,90 @@ function validateFragmentProps(fragment) {
|
|
|
1697
1875
|
setCurrentlyValidatingElement(null);
|
|
1698
1876
|
}
|
|
1699
1877
|
|
|
1878
|
+
function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
|
1879
|
+
var validType = isValidElementType(type);
|
|
1880
|
+
|
|
1881
|
+
// We warn in this case but don't throw. We expect the element creation to
|
|
1882
|
+
// succeed and there will likely be errors in render.
|
|
1883
|
+
if (!validType) {
|
|
1884
|
+
var info = '';
|
|
1885
|
+
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
|
1886
|
+
info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
|
|
1887
|
+
}
|
|
1888
|
+
|
|
1889
|
+
var sourceInfo = getSourceInfoErrorAddendum(source);
|
|
1890
|
+
if (sourceInfo) {
|
|
1891
|
+
info += sourceInfo;
|
|
1892
|
+
} else {
|
|
1893
|
+
info += getDeclarationErrorAddendum();
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1896
|
+
var typeString = void 0;
|
|
1897
|
+
if (type === null) {
|
|
1898
|
+
typeString = 'null';
|
|
1899
|
+
} else if (Array.isArray(type)) {
|
|
1900
|
+
typeString = 'array';
|
|
1901
|
+
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
1902
|
+
typeString = '<' + (getComponentName(type.type) || 'Unknown') + ' />';
|
|
1903
|
+
info = ' Did you accidentally export a JSX literal instead of a component?';
|
|
1904
|
+
} else {
|
|
1905
|
+
typeString = typeof type;
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1908
|
+
warning$1(false, 'React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
|
|
1909
|
+
}
|
|
1910
|
+
|
|
1911
|
+
var element = jsxDEV(type, props, key, source, self);
|
|
1912
|
+
|
|
1913
|
+
// The result can be nullish if a mock or a custom function is used.
|
|
1914
|
+
// TODO: Drop this when these are no longer allowed as the type argument.
|
|
1915
|
+
if (element == null) {
|
|
1916
|
+
return element;
|
|
1917
|
+
}
|
|
1918
|
+
|
|
1919
|
+
// Skip key warning if the type isn't valid since our key validation logic
|
|
1920
|
+
// doesn't expect a non-string/function type and can throw confusing errors.
|
|
1921
|
+
// We don't want exception behavior to differ between dev and prod.
|
|
1922
|
+
// (Rendering will throw with a helpful message and as soon as the type is
|
|
1923
|
+
// fixed, the key warnings will appear.)
|
|
1924
|
+
if (validType) {
|
|
1925
|
+
var children = props.children;
|
|
1926
|
+
if (children !== undefined) {
|
|
1927
|
+
if (isStaticChildren) {
|
|
1928
|
+
for (var i = 0; i < children.length; i++) {
|
|
1929
|
+
validateChildKeys(children[i], type);
|
|
1930
|
+
}
|
|
1931
|
+
} else {
|
|
1932
|
+
validateChildKeys(children, type);
|
|
1933
|
+
}
|
|
1934
|
+
}
|
|
1935
|
+
}
|
|
1936
|
+
|
|
1937
|
+
if (props.key !== undefined) {
|
|
1938
|
+
warning$1(false, 'React.jsx: Spreading a key to JSX is a deprecated pattern. ' + 'Explicitly pass a key after spreading props in your JSX call. ' + 'E.g. <ComponentName {...props} key={key} />');
|
|
1939
|
+
}
|
|
1940
|
+
|
|
1941
|
+
if (type === REACT_FRAGMENT_TYPE) {
|
|
1942
|
+
validateFragmentProps(element);
|
|
1943
|
+
} else {
|
|
1944
|
+
validatePropTypes(element);
|
|
1945
|
+
}
|
|
1946
|
+
|
|
1947
|
+
return element;
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1950
|
+
// These two functions exist to still get child warnings in dev
|
|
1951
|
+
// even with the prod transform. This means that jsxDEV is purely
|
|
1952
|
+
// opt-in behavior for better messages but that we won't stop
|
|
1953
|
+
// giving you warnings if you use production apis.
|
|
1954
|
+
function jsxWithValidationStatic(type, props, key) {
|
|
1955
|
+
return jsxWithValidation(type, props, key, true);
|
|
1956
|
+
}
|
|
1957
|
+
|
|
1958
|
+
function jsxWithValidationDynamic(type, props, key) {
|
|
1959
|
+
return jsxWithValidation(type, props, key, false);
|
|
1960
|
+
}
|
|
1961
|
+
|
|
1700
1962
|
function createElementWithValidation(type, props, children) {
|
|
1701
1963
|
var validType = isValidElementType(type);
|
|
1702
1964
|
|
|
@@ -1708,7 +1970,7 @@ function createElementWithValidation(type, props, children) {
|
|
|
1708
1970
|
info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
|
|
1709
1971
|
}
|
|
1710
1972
|
|
|
1711
|
-
var sourceInfo =
|
|
1973
|
+
var sourceInfo = getSourceInfoErrorAddendumForProps(props);
|
|
1712
1974
|
if (sourceInfo) {
|
|
1713
1975
|
info += sourceInfo;
|
|
1714
1976
|
} else {
|
|
@@ -1787,44 +2049,43 @@ function cloneElementWithValidation(element, props, children) {
|
|
|
1787
2049
|
return newElement;
|
|
1788
2050
|
}
|
|
1789
2051
|
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
// In some cases, StrictMode should also double-render lifecycles.
|
|
1794
|
-
// This can be confusing for tests though,
|
|
1795
|
-
// And it can be bad for performance in production.
|
|
1796
|
-
// This feature flag can be used to control the behavior:
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
// To preserve the "Pause on caught exceptions" behavior of the debugger, we
|
|
1800
|
-
// replay the begin phase of a failed component inside invokeGuardedCallback.
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
// Gather advanced timing metrics for Profiler subtrees.
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
// Trace which interactions trigger each commit.
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
// Only used in www builds.
|
|
1813
|
-
// TODO: true? Here it might just be false.
|
|
1814
|
-
|
|
1815
|
-
// Only used in www builds.
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
// Only used in www builds.
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
// React Fire: prevent the value and checked attributes from syncing
|
|
1822
|
-
// with their related DOM properties
|
|
2052
|
+
function noop() {}
|
|
1823
2053
|
|
|
2054
|
+
var error = noop;
|
|
2055
|
+
var warn = noop;
|
|
2056
|
+
{
|
|
2057
|
+
var ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
2058
|
+
|
|
2059
|
+
error = function () {
|
|
2060
|
+
var stack = ReactDebugCurrentFrame$2.getStackAddendum();
|
|
2061
|
+
if (stack !== '') {
|
|
2062
|
+
var length = arguments.length;
|
|
2063
|
+
var args = new Array(length + 1);
|
|
2064
|
+
for (var i = 0; i < length; i++) {
|
|
2065
|
+
args[i] = arguments[i];
|
|
2066
|
+
}
|
|
2067
|
+
args[length] = stack;
|
|
2068
|
+
console.error.apply(console, args);
|
|
2069
|
+
} else {
|
|
2070
|
+
console.error.apply(console, arguments);
|
|
2071
|
+
}
|
|
2072
|
+
};
|
|
1824
2073
|
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
2074
|
+
warn = function () {
|
|
2075
|
+
var stack = ReactDebugCurrentFrame$2.getStackAddendum();
|
|
2076
|
+
if (stack !== '') {
|
|
2077
|
+
var length = arguments.length;
|
|
2078
|
+
var args = new Array(length + 1);
|
|
2079
|
+
for (var i = 0; i < length; i++) {
|
|
2080
|
+
args[i] = arguments[i];
|
|
2081
|
+
}
|
|
2082
|
+
args[length] = stack;
|
|
2083
|
+
console.warn.apply(console, args);
|
|
2084
|
+
} else {
|
|
2085
|
+
console.warn.apply(console, arguments);
|
|
2086
|
+
}
|
|
2087
|
+
};
|
|
2088
|
+
}
|
|
1828
2089
|
|
|
1829
2090
|
var React = {
|
|
1830
2091
|
Children: {
|
|
@@ -1844,6 +2105,9 @@ var React = {
|
|
|
1844
2105
|
lazy: lazy,
|
|
1845
2106
|
memo: memo,
|
|
1846
2107
|
|
|
2108
|
+
error: error,
|
|
2109
|
+
warn: warn,
|
|
2110
|
+
|
|
1847
2111
|
useCallback: useCallback,
|
|
1848
2112
|
useContext: useContext,
|
|
1849
2113
|
useEffect: useEffect,
|
|
@@ -1856,6 +2120,7 @@ var React = {
|
|
|
1856
2120
|
useState: useState,
|
|
1857
2121
|
|
|
1858
2122
|
Fragment: REACT_FRAGMENT_TYPE,
|
|
2123
|
+
Profiler: REACT_PROFILER_TYPE,
|
|
1859
2124
|
StrictMode: REACT_STRICT_MODE_TYPE,
|
|
1860
2125
|
Suspense: REACT_SUSPENSE_TYPE,
|
|
1861
2126
|
|
|
@@ -1867,7 +2132,6 @@ var React = {
|
|
|
1867
2132
|
version: ReactVersion,
|
|
1868
2133
|
|
|
1869
2134
|
unstable_ConcurrentMode: REACT_CONCURRENT_MODE_TYPE,
|
|
1870
|
-
unstable_Profiler: REACT_PROFILER_TYPE,
|
|
1871
2135
|
|
|
1872
2136
|
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactSharedInternals
|
|
1873
2137
|
};
|
|
@@ -1879,9 +2143,15 @@ var React = {
|
|
|
1879
2143
|
|
|
1880
2144
|
if (enableStableConcurrentModeAPIs) {
|
|
1881
2145
|
React.ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
1882
|
-
React.Profiler = REACT_PROFILER_TYPE;
|
|
1883
2146
|
React.unstable_ConcurrentMode = undefined;
|
|
1884
|
-
|
|
2147
|
+
}
|
|
2148
|
+
|
|
2149
|
+
if (enableJSXTransformAPI) {
|
|
2150
|
+
{
|
|
2151
|
+
React.jsxDEV = jsxWithValidation;
|
|
2152
|
+
React.jsx = jsxWithValidationDynamic;
|
|
2153
|
+
React.jsxs = jsxWithValidationStatic;
|
|
2154
|
+
}
|
|
1885
2155
|
}
|
|
1886
2156
|
|
|
1887
2157
|
|