react 0.0.0-f22621f88 → 0.0.0-fa1e8df11

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 CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
- "branch": "pull/14555",
3
- "buildNumber": "12980",
4
- "checksum": "0715bcb",
5
- "commit": "f22621f88",
2
+ "branch": "master",
3
+ "buildNumber": "18068",
4
+ "checksum": "486c52d",
5
+ "commit": "fa1e8df11",
6
6
  "environment": "ci",
7
- "reactVersion": "16.7.0-canary-f22621f88"
7
+ "reactVersion": "16.8.6-canary-fa1e8df11"
8
8
  }
@@ -1,4 +1,4 @@
1
- /** @license React v0.0.0-f22621f88
1
+ /** @license React v0.0.0-fa1e8df11
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.7.0-canary-f22621f88';
23
+ var ReactVersion = '16.8.6-canary-fa1e8df11';
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.
@@ -33,12 +33,19 @@ var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeac
33
33
  var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
34
34
  var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
35
35
  var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
36
+ // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
37
+ // (unstable) APIs that have been removed. Can we remove the symbols?
36
38
 
37
39
  var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
38
40
  var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
39
41
  var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
40
42
  var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
41
43
  var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
44
+ var REACT_EVENT_COMPONENT_TYPE = hasSymbol ? Symbol.for('react.event_component') : 0xead5;
45
+ var REACT_EVENT_TARGET_TYPE = hasSymbol ? Symbol.for('react.event_target') : 0xead6;
46
+
47
+ // React event targets
48
+ var REACT_EVENT_TARGET_TOUCH_HIT = hasSymbol ? Symbol.for('react.event_target.touch_hit') : 0xead7;
42
49
 
43
50
  var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
44
51
  var FAUX_ITERATOR_SYMBOL = '@@iterator';
@@ -54,45 +61,19 @@ function getIteratorFn(maybeIterable) {
54
61
  return null;
55
62
  }
56
63
 
57
- var enableHooks = true;
58
- // Helps identify side effects in begin-phase lifecycle hooks and setState reducers:
59
-
60
-
61
- // In some cases, StrictMode should also double-render lifecycles.
62
- // This can be confusing for tests though,
63
- // And it can be bad for performance in production.
64
- // This feature flag can be used to control the behavior:
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.
65
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.
66
71
 
67
- // To preserve the "Pause on caught exceptions" behavior of the debugger, we
68
- // replay the begin phase of a failed component inside invokeGuardedCallback.
69
-
70
-
71
- // Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
72
-
73
-
74
- // Gather advanced timing metrics for Profiler subtrees.
75
-
76
-
77
- // Trace which interactions trigger each commit.
78
-
79
-
80
- // Only used in www builds.
81
- // TODO: true? Here it might just be false.
82
-
83
- // Only used in www builds.
84
-
85
-
86
- // Only used in www builds.
87
-
88
-
89
- // React Fire: prevent the value and checked attributes from syncing
90
- // with their related DOM properties
91
-
92
-
93
- // These APIs will no longer be "unstable" in the upcoming 16.7 release,
94
- // Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
95
- var enableStableConcurrentModeAPIs = true;
72
+ function ReactError(message) {
73
+ var error = new Error(message);
74
+ error.name = 'Invariant Violation';
75
+ return error;
76
+ }
96
77
 
97
78
  /**
98
79
  * Use invariant() to assert state which your program assumes to be true.
@@ -105,40 +86,6 @@ var enableStableConcurrentModeAPIs = true;
105
86
  * will remain to ensure logic does not differ in production.
106
87
  */
107
88
 
108
- var validateFormat = function () {};
109
-
110
- {
111
- validateFormat = function (format) {
112
- if (format === undefined) {
113
- throw new Error('invariant requires an error message argument');
114
- }
115
- };
116
- }
117
-
118
- function invariant(condition, format, a, b, c, d, e, f) {
119
- validateFormat(format);
120
-
121
- if (!condition) {
122
- var error = void 0;
123
- if (format === undefined) {
124
- error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
125
- } else {
126
- var args = [a, b, c, d, e, f];
127
- var argIndex = 0;
128
- error = new Error(format.replace(/%s/g, function () {
129
- return args[argIndex++];
130
- }));
131
- error.name = 'Invariant Violation';
132
- }
133
-
134
- error.framesToPop = 1; // we don't care about invariant's own frame
135
- throw error;
136
- }
137
- }
138
-
139
- // Relying on the `invariant()` implementation lets us
140
- // preserve the format and params in the www builds.
141
-
142
89
  /**
143
90
  * Forked from fbjs/warning:
144
91
  * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
@@ -371,7 +318,13 @@ Component.prototype.isReactComponent = {};
371
318
  * @protected
372
319
  */
373
320
  Component.prototype.setState = function (partialState, callback) {
374
- !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : void 0;
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
+ })();
375
328
  this.updater.enqueueSetState(this, partialState, callback, 'setState');
376
329
  };
377
330
 
@@ -438,6 +391,86 @@ pureComponentPrototype.constructor = PureComponent;
438
391
  _assign(pureComponentPrototype, Component.prototype);
439
392
  pureComponentPrototype.isPureReactComponent = true;
440
393
 
394
+ // Helps identify side effects in begin-phase lifecycle hooks and setState reducers:
395
+
396
+
397
+ // In some cases, StrictMode should also double-render lifecycles.
398
+ // This can be confusing for tests though,
399
+ // And it can be bad for performance in production.
400
+ // This feature flag can be used to control the behavior:
401
+
402
+
403
+ // To preserve the "Pause on caught exceptions" behavior of the debugger, we
404
+ // replay the begin phase of a failed component inside invokeGuardedCallback.
405
+
406
+
407
+ // Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
408
+
409
+
410
+ // Gather advanced timing metrics for Profiler subtrees.
411
+
412
+
413
+ // Trace which interactions trigger each commit.
414
+
415
+
416
+ // Only used in www builds.
417
+ // TODO: true? Here it might just be false.
418
+
419
+ // Only used in www builds.
420
+
421
+
422
+ // Only used in www builds.
423
+
424
+
425
+ // Disable javascript: URL strings in href for XSS protection.
426
+
427
+
428
+ // Disables yielding during render in Concurrent Mode. Used for debugging only.
429
+
430
+
431
+ // React Fire: prevent the value and checked attributes from syncing
432
+ // with their related DOM properties
433
+
434
+
435
+ // These APIs will no longer be "unstable" in the upcoming 16.7 release,
436
+ // Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
437
+
438
+
439
+
440
+
441
+ // See https://github.com/react-native-community/discussions-and-proposals/issues/72 for more information
442
+ // This is a flag so we can fix warnings in RN core before turning it on
443
+
444
+
445
+ // Experimental React Events support. Only used in www builds for now.
446
+ var enableEventAPI = false;
447
+
448
+ // New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107
449
+ var enableJSXTransformAPI = false;
450
+
451
+ // We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)
452
+ // Till then, we warn about the missing mock, but still fallback to a sync mode compatible version
453
+
454
+ // Temporary flag to revert the fix in #15650
455
+
456
+ function createEventComponent(responder, displayName) {
457
+ if (enableEventAPI) {
458
+ {
459
+ Object.freeze(responder);
460
+ }
461
+ var eventComponent = {
462
+ $$typeof: REACT_EVENT_COMPONENT_TYPE,
463
+ displayName: displayName,
464
+ props: null,
465
+ responder: responder
466
+ };
467
+ {
468
+ Object.freeze(eventComponent);
469
+ }
470
+ return eventComponent;
471
+ }
472
+ }
473
+
441
474
  // an immutable object with a single mutable value
442
475
  function createRef() {
443
476
  var refObject = {
@@ -460,6 +493,14 @@ var ReactCurrentDispatcher = {
460
493
  current: null
461
494
  };
462
495
 
496
+ /**
497
+ * Keeps track of the current batch's configuration such as how long an update
498
+ * should suspend for if it needs to.
499
+ */
500
+ var ReactCurrentBatchConfig = {
501
+ suspense: null
502
+ };
503
+
463
504
  /**
464
505
  * Keeps track of the current owner.
465
506
  *
@@ -531,8 +572,6 @@ function getComponentName(type) {
531
572
  return type;
532
573
  }
533
574
  switch (type) {
534
- case REACT_CONCURRENT_MODE_TYPE:
535
- return 'ConcurrentMode';
536
575
  case REACT_FRAGMENT_TYPE:
537
576
  return 'Fragment';
538
577
  case REACT_PORTAL_TYPE:
@@ -561,6 +600,28 @@ function getComponentName(type) {
561
600
  if (resolvedThenable) {
562
601
  return getComponentName(resolvedThenable);
563
602
  }
603
+ break;
604
+ }
605
+ case REACT_EVENT_COMPONENT_TYPE:
606
+ {
607
+ if (enableEventAPI) {
608
+ var eventComponent = type;
609
+ return eventComponent.displayName;
610
+ }
611
+ break;
612
+ }
613
+ case REACT_EVENT_TARGET_TYPE:
614
+ {
615
+ if (enableEventAPI) {
616
+ var eventTarget = type;
617
+ if (eventTarget.type === REACT_EVENT_TARGET_TOUCH_HIT) {
618
+ return 'TouchHitTarget';
619
+ }
620
+ var displayName = eventTarget.displayName;
621
+ if (displayName !== undefined) {
622
+ return displayName;
623
+ }
624
+ }
564
625
  }
565
626
  }
566
627
  }
@@ -601,9 +662,21 @@ function setCurrentlyValidatingElement(element) {
601
662
  };
602
663
  }
603
664
 
665
+ /**
666
+ * Used by act() to track whether you're outside an act() scope.
667
+ * We use a renderer's flushPassiveEffects as the sigil value
668
+ * so we can track identity of the renderer.
669
+ */
670
+
671
+ var ReactCurrentActingRendererSigil = {
672
+ current: null
673
+ };
674
+
604
675
  var ReactSharedInternals = {
605
676
  ReactCurrentDispatcher: ReactCurrentDispatcher,
677
+ ReactCurrentBatchConfig: ReactCurrentBatchConfig,
606
678
  ReactCurrentOwner: ReactCurrentOwner,
679
+ ReactCurrentActingRendererSigil: ReactCurrentActingRendererSigil,
607
680
  // Used by renderers to avoid bundling object-assign twice in UMD bundles:
608
681
  assign: _assign
609
682
  };
@@ -717,8 +790,10 @@ function defineRefPropWarningGetter(props, displayName) {
717
790
  * if something is a React Element.
718
791
  *
719
792
  * @param {*} type
793
+ * @param {*} props
720
794
  * @param {*} key
721
795
  * @param {string|object} ref
796
+ * @param {*} owner
722
797
  * @param {*} self A *temporary* helper to detect places where `this` is
723
798
  * different from the `owner` when React.createElement is called, so that we
724
799
  * can warn. We want to get rid of owner and replace string `ref`s with arrow
@@ -726,8 +801,6 @@ function defineRefPropWarningGetter(props, displayName) {
726
801
  * change in behavior.
727
802
  * @param {*} source An annotation object (added by a transpiler or otherwise)
728
803
  * indicating filename, line number, and/or other information.
729
- * @param {*} owner
730
- * @param {*} props
731
804
  * @internal
732
805
  */
733
806
  var ReactElement = function (type, key, ref, self, source, owner, props) {
@@ -786,6 +859,73 @@ var ReactElement = function (type, key, ref, self, source, owner, props) {
786
859
  return element;
787
860
  };
788
861
 
862
+ /**
863
+ * https://github.com/reactjs/rfcs/pull/107
864
+ * @param {*} type
865
+ * @param {object} props
866
+ * @param {string} key
867
+ */
868
+
869
+
870
+ /**
871
+ * https://github.com/reactjs/rfcs/pull/107
872
+ * @param {*} type
873
+ * @param {object} props
874
+ * @param {string} key
875
+ */
876
+ function jsxDEV(type, config, maybeKey, source, self) {
877
+ var propName = void 0;
878
+
879
+ // Reserved names are extracted
880
+ var props = {};
881
+
882
+ var key = null;
883
+ var ref = null;
884
+
885
+ if (hasValidRef(config)) {
886
+ ref = config.ref;
887
+ }
888
+
889
+ if (hasValidKey(config)) {
890
+ key = '' + config.key;
891
+ }
892
+
893
+ // Remaining properties are added to a new props object
894
+ for (propName in config) {
895
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
896
+ props[propName] = config[propName];
897
+ }
898
+ }
899
+
900
+ // intentionally not checking if key was set above
901
+ // this key is higher priority as it's static
902
+ if (maybeKey !== undefined) {
903
+ key = '' + maybeKey;
904
+ }
905
+
906
+ // Resolve default props
907
+ if (type && type.defaultProps) {
908
+ var defaultProps = type.defaultProps;
909
+ for (propName in defaultProps) {
910
+ if (props[propName] === undefined) {
911
+ props[propName] = defaultProps[propName];
912
+ }
913
+ }
914
+ }
915
+
916
+ if (key || ref) {
917
+ var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
918
+ if (key) {
919
+ defineKeyPropWarningGetter(props, displayName);
920
+ }
921
+ if (ref) {
922
+ defineRefPropWarningGetter(props, displayName);
923
+ }
924
+ }
925
+
926
+ return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
927
+ }
928
+
789
929
  /**
790
930
  * Create and return a new ReactElement of the given type.
791
931
  * See https://reactjs.org/docs/react-api.html#createelement
@@ -877,7 +1017,13 @@ function cloneAndReplaceKey(oldElement, newKey) {
877
1017
  * See https://reactjs.org/docs/react-api.html#cloneelement
878
1018
  */
879
1019
  function cloneElement(element, config, children) {
880
- !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;
1020
+ (function () {
1021
+ if (!!(element === null || element === undefined)) {
1022
+ {
1023
+ throw ReactError('React.cloneElement(...): The argument must be a React element, but you passed ' + element + '.');
1024
+ }
1025
+ }
1026
+ })();
881
1027
 
882
1028
  var propName = void 0;
883
1029
 
@@ -1097,7 +1243,13 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
1097
1243
  addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum();
1098
1244
  }
1099
1245
  var childrenString = '' + children;
1100
- invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum);
1246
+ (function () {
1247
+ {
1248
+ {
1249
+ throw ReactError('Objects are not valid as a React child (found: ' + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + ').' + addendum);
1250
+ }
1251
+ }
1252
+ })();
1101
1253
  }
1102
1254
  }
1103
1255
 
@@ -1273,7 +1425,13 @@ function toArray(children) {
1273
1425
  * structure.
1274
1426
  */
1275
1427
  function onlyChild(children) {
1276
- !isValidElement(children) ? invariant(false, 'React.Children.only expected to receive a single React element child.') : void 0;
1428
+ (function () {
1429
+ if (!isValidElement(children)) {
1430
+ {
1431
+ throw ReactError('React.Children.only expected to receive a single React element child.');
1432
+ }
1433
+ }
1434
+ })();
1277
1435
  return children;
1278
1436
  }
1279
1437
 
@@ -1455,7 +1613,7 @@ function forwardRef(render) {
1455
1613
  function isValidElementType(type) {
1456
1614
  return typeof type === 'string' || typeof type === 'function' ||
1457
1615
  // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
1458
- 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);
1616
+ 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);
1459
1617
  }
1460
1618
 
1461
1619
  function memo(type, compare) {
@@ -1473,13 +1631,21 @@ function memo(type, compare) {
1473
1631
 
1474
1632
  function resolveDispatcher() {
1475
1633
  var dispatcher = ReactCurrentDispatcher.current;
1476
- !(dispatcher !== null) ? invariant(false, 'Hooks can only be called inside the body of a function component.') : void 0;
1634
+ (function () {
1635
+ if (!(dispatcher !== null)) {
1636
+ {
1637
+ 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.');
1638
+ }
1639
+ }
1640
+ })();
1477
1641
  return dispatcher;
1478
1642
  }
1479
1643
 
1480
- function useContext(Context, observedBits) {
1644
+ function useContext(Context, unstable_observedBits) {
1481
1645
  var dispatcher = resolveDispatcher();
1482
1646
  {
1647
+ !(unstable_observedBits === undefined) ? warning$1(false, 'useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://fb.me/rules-of-hooks' : '') : void 0;
1648
+
1483
1649
  // TODO: add a more generic warning for invalid values.
1484
1650
  if (Context._context !== undefined) {
1485
1651
  var realContext = Context._context;
@@ -1492,7 +1658,7 @@ function useContext(Context, observedBits) {
1492
1658
  }
1493
1659
  }
1494
1660
  }
1495
- return dispatcher.useContext(Context, observedBits);
1661
+ return dispatcher.useContext(Context, unstable_observedBits);
1496
1662
  }
1497
1663
 
1498
1664
  function useState(initialState) {
@@ -1500,9 +1666,9 @@ function useState(initialState) {
1500
1666
  return dispatcher.useState(initialState);
1501
1667
  }
1502
1668
 
1503
- function useReducer(reducer, initialState, initialAction) {
1669
+ function useReducer(reducer, initialArg, init) {
1504
1670
  var dispatcher = resolveDispatcher();
1505
- return dispatcher.useReducer(reducer, initialState, initialAction);
1671
+ return dispatcher.useReducer(reducer, initialArg, init);
1506
1672
  }
1507
1673
 
1508
1674
  function useRef(initialValue) {
@@ -1530,9 +1696,27 @@ function useMemo(create, inputs) {
1530
1696
  return dispatcher.useMemo(create, inputs);
1531
1697
  }
1532
1698
 
1533
- function useImperativeMethods(ref, create, inputs) {
1699
+ function useImperativeHandle(ref, create, inputs) {
1534
1700
  var dispatcher = resolveDispatcher();
1535
- return dispatcher.useImperativeMethods(ref, create, inputs);
1701
+ return dispatcher.useImperativeHandle(ref, create, inputs);
1702
+ }
1703
+
1704
+ function useDebugValue(value, formatterFn) {
1705
+ {
1706
+ var dispatcher = resolveDispatcher();
1707
+ return dispatcher.useDebugValue(value, formatterFn);
1708
+ }
1709
+ }
1710
+
1711
+ // Within the scope of the callback, mark all updates as being allowed to suspend.
1712
+ function withSuspenseConfig(scope, config) {
1713
+ var previousConfig = ReactCurrentBatchConfig.suspense;
1714
+ ReactCurrentBatchConfig.suspense = config === undefined ? null : config;
1715
+ try {
1716
+ scope();
1717
+ } finally {
1718
+ ReactCurrentBatchConfig.suspense = previousConfig;
1719
+ }
1536
1720
  }
1537
1721
 
1538
1722
  /**
@@ -1558,9 +1742,8 @@ function getDeclarationErrorAddendum() {
1558
1742
  return '';
1559
1743
  }
1560
1744
 
1561
- function getSourceInfoErrorAddendum(elementProps) {
1562
- if (elementProps !== null && elementProps !== undefined && elementProps.__source !== undefined) {
1563
- var source = elementProps.__source;
1745
+ function getSourceInfoErrorAddendum(source) {
1746
+ if (source !== undefined) {
1564
1747
  var fileName = source.fileName.replace(/^.*[\\\/]/, '');
1565
1748
  var lineNumber = source.lineNumber;
1566
1749
  return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
@@ -1568,6 +1751,13 @@ function getSourceInfoErrorAddendum(elementProps) {
1568
1751
  return '';
1569
1752
  }
1570
1753
 
1754
+ function getSourceInfoErrorAddendumForProps(elementProps) {
1755
+ if (elementProps !== null && elementProps !== undefined) {
1756
+ return getSourceInfoErrorAddendum(elementProps.__source);
1757
+ }
1758
+ return '';
1759
+ }
1760
+
1571
1761
  /**
1572
1762
  * Warn if there's no key explicitly set on dynamic arrays of children or
1573
1763
  * object keys are not valid. This allows us to keep track of children between
@@ -1728,6 +1918,90 @@ function validateFragmentProps(fragment) {
1728
1918
  setCurrentlyValidatingElement(null);
1729
1919
  }
1730
1920
 
1921
+ function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
1922
+ var validType = isValidElementType(type);
1923
+
1924
+ // We warn in this case but don't throw. We expect the element creation to
1925
+ // succeed and there will likely be errors in render.
1926
+ if (!validType) {
1927
+ var info = '';
1928
+ if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
1929
+ 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.";
1930
+ }
1931
+
1932
+ var sourceInfo = getSourceInfoErrorAddendum(source);
1933
+ if (sourceInfo) {
1934
+ info += sourceInfo;
1935
+ } else {
1936
+ info += getDeclarationErrorAddendum();
1937
+ }
1938
+
1939
+ var typeString = void 0;
1940
+ if (type === null) {
1941
+ typeString = 'null';
1942
+ } else if (Array.isArray(type)) {
1943
+ typeString = 'array';
1944
+ } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
1945
+ typeString = '<' + (getComponentName(type.type) || 'Unknown') + ' />';
1946
+ info = ' Did you accidentally export a JSX literal instead of a component?';
1947
+ } else {
1948
+ typeString = typeof type;
1949
+ }
1950
+
1951
+ 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);
1952
+ }
1953
+
1954
+ var element = jsxDEV(type, props, key, source, self);
1955
+
1956
+ // The result can be nullish if a mock or a custom function is used.
1957
+ // TODO: Drop this when these are no longer allowed as the type argument.
1958
+ if (element == null) {
1959
+ return element;
1960
+ }
1961
+
1962
+ // Skip key warning if the type isn't valid since our key validation logic
1963
+ // doesn't expect a non-string/function type and can throw confusing errors.
1964
+ // We don't want exception behavior to differ between dev and prod.
1965
+ // (Rendering will throw with a helpful message and as soon as the type is
1966
+ // fixed, the key warnings will appear.)
1967
+ if (validType) {
1968
+ var children = props.children;
1969
+ if (children !== undefined) {
1970
+ if (isStaticChildren) {
1971
+ for (var i = 0; i < children.length; i++) {
1972
+ validateChildKeys(children[i], type);
1973
+ }
1974
+ } else {
1975
+ validateChildKeys(children, type);
1976
+ }
1977
+ }
1978
+ }
1979
+
1980
+ if (props.key !== undefined) {
1981
+ 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} />');
1982
+ }
1983
+
1984
+ if (type === REACT_FRAGMENT_TYPE) {
1985
+ validateFragmentProps(element);
1986
+ } else {
1987
+ validatePropTypes(element);
1988
+ }
1989
+
1990
+ return element;
1991
+ }
1992
+
1993
+ // These two functions exist to still get child warnings in dev
1994
+ // even with the prod transform. This means that jsxDEV is purely
1995
+ // opt-in behavior for better messages but that we won't stop
1996
+ // giving you warnings if you use production apis.
1997
+ function jsxWithValidationStatic(type, props, key) {
1998
+ return jsxWithValidation(type, props, key, true);
1999
+ }
2000
+
2001
+ function jsxWithValidationDynamic(type, props, key) {
2002
+ return jsxWithValidation(type, props, key, false);
2003
+ }
2004
+
1731
2005
  function createElementWithValidation(type, props, children) {
1732
2006
  var validType = isValidElementType(type);
1733
2007
 
@@ -1739,7 +2013,7 @@ function createElementWithValidation(type, props, children) {
1739
2013
  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.";
1740
2014
  }
1741
2015
 
1742
- var sourceInfo = getSourceInfoErrorAddendum(props);
2016
+ var sourceInfo = getSourceInfoErrorAddendumForProps(props);
1743
2017
  if (sourceInfo) {
1744
2018
  info += sourceInfo;
1745
2019
  } else {
@@ -1818,6 +2092,44 @@ function cloneElementWithValidation(element, props, children) {
1818
2092
  return newElement;
1819
2093
  }
1820
2094
 
2095
+ function noop() {}
2096
+
2097
+ var error = noop;
2098
+ var warn = noop;
2099
+ {
2100
+ var ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame;
2101
+
2102
+ error = function () {
2103
+ var stack = ReactDebugCurrentFrame$2.getStackAddendum();
2104
+ if (stack !== '') {
2105
+ var length = arguments.length;
2106
+ var args = new Array(length + 1);
2107
+ for (var i = 0; i < length; i++) {
2108
+ args[i] = arguments[i];
2109
+ }
2110
+ args[length] = stack;
2111
+ console.error.apply(console, args);
2112
+ } else {
2113
+ console.error.apply(console, arguments);
2114
+ }
2115
+ };
2116
+
2117
+ warn = function () {
2118
+ var stack = ReactDebugCurrentFrame$2.getStackAddendum();
2119
+ if (stack !== '') {
2120
+ var length = arguments.length;
2121
+ var args = new Array(length + 1);
2122
+ for (var i = 0; i < length; i++) {
2123
+ args[i] = arguments[i];
2124
+ }
2125
+ args[length] = stack;
2126
+ console.warn.apply(console, args);
2127
+ } else {
2128
+ console.warn.apply(console, arguments);
2129
+ }
2130
+ };
2131
+ }
2132
+
1821
2133
  var React = {
1822
2134
  Children: {
1823
2135
  map: mapChildren,
@@ -1836,7 +2148,22 @@ var React = {
1836
2148
  lazy: lazy,
1837
2149
  memo: memo,
1838
2150
 
2151
+ error: error,
2152
+ warn: warn,
2153
+
2154
+ useCallback: useCallback,
2155
+ useContext: useContext,
2156
+ useEffect: useEffect,
2157
+ useImperativeHandle: useImperativeHandle,
2158
+ useDebugValue: useDebugValue,
2159
+ useLayoutEffect: useLayoutEffect,
2160
+ useMemo: useMemo,
2161
+ useReducer: useReducer,
2162
+ useRef: useRef,
2163
+ useState: useState,
2164
+
1839
2165
  Fragment: REACT_FRAGMENT_TYPE,
2166
+ Profiler: REACT_PROFILER_TYPE,
1840
2167
  StrictMode: REACT_STRICT_MODE_TYPE,
1841
2168
  Suspense: REACT_SUSPENSE_TYPE,
1842
2169
 
@@ -1847,8 +2174,7 @@ var React = {
1847
2174
 
1848
2175
  version: ReactVersion,
1849
2176
 
1850
- unstable_ConcurrentMode: REACT_CONCURRENT_MODE_TYPE,
1851
- unstable_Profiler: REACT_PROFILER_TYPE,
2177
+ unstable_withSuspenseConfig: withSuspenseConfig,
1852
2178
 
1853
2179
  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactSharedInternals
1854
2180
  };
@@ -1858,23 +2184,16 @@ var React = {
1858
2184
  // don't modify the React object to avoid deopts.
1859
2185
  // Also let's not expose their names in stable builds.
1860
2186
 
1861
- if (enableStableConcurrentModeAPIs) {
1862
- React.ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
1863
- React.Profiler = REACT_PROFILER_TYPE;
1864
- React.unstable_ConcurrentMode = undefined;
1865
- React.unstable_Profiler = undefined;
1866
- }
1867
-
1868
- if (enableHooks) {
1869
- React.useCallback = useCallback;
1870
- React.useContext = useContext;
1871
- React.useEffect = useEffect;
1872
- React.useImperativeMethods = useImperativeMethods;
1873
- React.useLayoutEffect = useLayoutEffect;
1874
- React.useMemo = useMemo;
1875
- React.useReducer = useReducer;
1876
- React.useRef = useRef;
1877
- React.useState = useState;
2187
+ if (enableEventAPI) {
2188
+ React.unstable_createEventComponent = createEventComponent;
2189
+ }
2190
+
2191
+ if (enableJSXTransformAPI) {
2192
+ {
2193
+ React.jsxDEV = jsxWithValidation;
2194
+ React.jsx = jsxWithValidationDynamic;
2195
+ React.jsxs = jsxWithValidationStatic;
2196
+ }
1878
2197
  }
1879
2198
 
1880
2199