react 16.0.0 → 16.1.0-beta

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # react
2
2
 
3
- An npm package to get you immediate access to [React](https://facebook.github.io/react/),
3
+ An npm package to get you immediate access to [React](https://reactjs.org/),
4
4
  without also requiring the JSX transformer. This is especially useful for cases where you
5
5
  want to [`browserify`](https://github.com/substack/node-browserify) your module using
6
6
  `React`.
@@ -1,4 +1,4 @@
1
- /** @license React v16.0.0
1
+ /** @license React v16.1.0-beta
2
2
  * react.development.js
3
3
  *
4
4
  * Copyright (c) 2013-present, Facebook, Inc.
@@ -14,31 +14,149 @@ if (process.env.NODE_ENV !== "production") {
14
14
 
15
15
  'use strict';
16
16
 
17
- var objectAssign$1 = require('object-assign');
18
- var require$$0 = require('fbjs/lib/warning');
17
+ var _assign = require('object-assign');
19
18
  var emptyObject = require('fbjs/lib/emptyObject');
20
19
  var invariant = require('fbjs/lib/invariant');
20
+ var warning = require('fbjs/lib/warning');
21
21
  var emptyFunction = require('fbjs/lib/emptyFunction');
22
22
  var checkPropTypes = require('prop-types/checkPropTypes');
23
23
 
24
+ /**
25
+ * Copyright (c) 2013-present, Facebook, Inc.
26
+ *
27
+ * This source code is licensed under the MIT license found in the
28
+ * LICENSE file in the root directory of this source tree.
29
+ */
30
+
31
+
32
+
33
+ // TODO: this is special because it gets imported during build.
34
+
35
+ var ReactVersion = '16.1.0-beta';
36
+
37
+ var ReactFeatureFlags = {
38
+ enableAsyncSubtreeAPI: true,
39
+ enableAsyncSchedulingByDefaultInReactDOM: false,
40
+ // Mutating mode (React DOM, React ART, React Native):
41
+ enableMutatingReconciler: true,
42
+ // Experimental noop mode (currently unused):
43
+ enableNoopReconciler: false,
44
+ // Experimental persistent mode (CS):
45
+ enablePersistentReconciler: false,
46
+ // Exports React.Fragment
47
+ enableReactFragment: false,
48
+ // Exports ReactDOM.createRoot
49
+ enableCreateRoot: false
50
+ }; /**
51
+ * Copyright (c) 2013-present, Facebook, Inc.
52
+ *
53
+ * This source code is licensed under the MIT license found in the
54
+ * LICENSE file in the root directory of this source tree.
55
+ *
56
+ *
57
+ */
58
+
59
+ {
60
+ if (Object.freeze) {
61
+ Object.freeze(ReactFeatureFlags);
62
+ }
63
+ }
64
+
24
65
  /**
25
66
  * Copyright (c) 2013-present, Facebook, Inc.
26
67
  *
27
68
  * This source code is licensed under the MIT license found in the
28
69
  * LICENSE file in the root directory of this source tree.
29
70
  *
30
- * @providesModule reactProdInvariant
31
71
  *
32
72
  */
33
73
 
74
+ /**
75
+ * WARNING: DO NOT manually require this module.
76
+ * This is a replacement for `invariant(...)` used by the error code system
77
+ * and will _only_ be required by the corresponding babel pass.
78
+ * It always throws.
79
+ */
80
+
81
+ /**
82
+ * Copyright (c) 2014-present, Facebook, Inc.
83
+ *
84
+ * This source code is licensed under the MIT license found in the
85
+ * LICENSE file in the root directory of this source tree.
86
+ */
87
+
88
+ /**
89
+ * Forked from fbjs/warning:
90
+ * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
91
+ *
92
+ * Only change is we use console.warn instead of console.error,
93
+ * and do nothing when 'console' is not supported.
94
+ * This really simplifies the code.
95
+ * ---
96
+ * Similar to invariant but only logs a warning if the condition is not met.
97
+ * This can be used to log issues in development environments in critical
98
+ * paths. Removing the logging code for production environments will keep the
99
+ * same logic and follow the same code paths.
100
+ */
101
+
102
+ var lowPriorityWarning = function () {};
103
+
34
104
  {
35
- var warning = require$$0;
105
+ var printWarning = function (format) {
106
+ for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
107
+ args[_key - 1] = arguments[_key];
108
+ }
109
+
110
+ var argIndex = 0;
111
+ var message = 'Warning: ' + format.replace(/%s/g, function () {
112
+ return args[argIndex++];
113
+ });
114
+ if (typeof console !== 'undefined') {
115
+ console.warn(message);
116
+ }
117
+ try {
118
+ // --- Welcome to debugging React ---
119
+ // This error was thrown as a convenience so that you can use this stack
120
+ // to find the callsite that caused this warning to fire.
121
+ throw new Error(message);
122
+ } catch (x) {}
123
+ };
124
+
125
+ lowPriorityWarning = function (condition, format) {
126
+ if (format === undefined) {
127
+ throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
128
+ }
129
+ if (!condition) {
130
+ for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
131
+ args[_key2 - 2] = arguments[_key2];
132
+ }
133
+
134
+ printWarning.apply(undefined, [format].concat(args));
135
+ }
136
+ };
36
137
  }
37
138
 
139
+ var lowPriorityWarning$1 = lowPriorityWarning;
140
+
141
+ /**
142
+ * Copyright (c) 2015-present, Facebook, Inc.
143
+ *
144
+ * This source code is licensed under the MIT license found in the
145
+ * LICENSE file in the root directory of this source tree.
146
+ */
147
+
148
+ var didWarnStateUpdateForUnmountedComponent = {};
149
+
38
150
  function warnNoop(publicInstance, callerName) {
39
151
  {
40
152
  var constructor = publicInstance.constructor;
41
- warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op.\n\nPlease check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass');
153
+ var componentName = constructor && (constructor.displayName || constructor.name) || 'ReactClass';
154
+ var warningKey = componentName + '.' + callerName;
155
+ if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
156
+ return;
157
+ }
158
+ warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op.\n\nPlease check the code for the %s component.', callerName, callerName, componentName);
159
+ didWarnStateUpdateForUnmountedComponent[warningKey] = true;
42
160
  }
43
161
  }
44
162
 
@@ -110,83 +228,26 @@ var ReactNoopUpdateQueue = {
110
228
  }
111
229
  };
112
230
 
113
- var ReactNoopUpdateQueue_1 = ReactNoopUpdateQueue;
114
-
115
231
  /**
116
- * Copyright (c) 2014-present, Facebook, Inc.
232
+ * Copyright (c) 2013-present, Facebook, Inc.
117
233
  *
118
234
  * This source code is licensed under the MIT license found in the
119
235
  * LICENSE file in the root directory of this source tree.
120
- *
121
- * @providesModule lowPriorityWarning
122
236
  */
123
237
 
124
- /**
125
- * Forked from fbjs/warning:
126
- * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
127
- *
128
- * Only change is we use console.warn instead of console.error,
129
- * and do nothing when 'console' is not supported.
130
- * This really simplifies the code.
131
- * ---
132
- * Similar to invariant but only logs a warning if the condition is not met.
133
- * This can be used to log issues in development environments in critical
134
- * paths. Removing the logging code for production environments will keep the
135
- * same logic and follow the same code paths.
136
- */
137
-
138
- var lowPriorityWarning = function () {};
139
-
140
- {
141
- var printWarning = function (format) {
142
- for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
143
- args[_key - 1] = arguments[_key];
144
- }
145
-
146
- var argIndex = 0;
147
- var message = 'Warning: ' + format.replace(/%s/g, function () {
148
- return args[argIndex++];
149
- });
150
- if (typeof console !== 'undefined') {
151
- console.warn(message);
152
- }
153
- try {
154
- // --- Welcome to debugging React ---
155
- // This error was thrown as a convenience so that you can use this stack
156
- // to find the callsite that caused this warning to fire.
157
- throw new Error(message);
158
- } catch (x) {}
159
- };
160
-
161
- lowPriorityWarning = function (condition, format) {
162
- if (format === undefined) {
163
- throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
164
- }
165
- if (!condition) {
166
- for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
167
- args[_key2 - 2] = arguments[_key2];
168
- }
169
-
170
- printWarning.apply(undefined, [format].concat(args));
171
- }
172
- };
173
- }
174
-
175
- var lowPriorityWarning_1 = lowPriorityWarning;
176
-
177
238
  /**
178
239
  * Base class helpers for the updating state of a component.
179
240
  */
180
- function ReactComponent(props, context, updater) {
241
+ function Component(props, context, updater) {
181
242
  this.props = props;
182
243
  this.context = context;
183
244
  this.refs = emptyObject;
184
245
  // We initialize the default updater but the real one gets injected by the
185
246
  // renderer.
186
- this.updater = updater || ReactNoopUpdateQueue_1;
247
+ this.updater = updater || ReactNoopUpdateQueue;
187
248
  }
188
249
 
189
- ReactComponent.prototype.isReactComponent = {};
250
+ Component.prototype.isReactComponent = {};
190
251
 
191
252
  /**
192
253
  * Sets a subset of the state. Always use this to mutate
@@ -213,7 +274,7 @@ ReactComponent.prototype.isReactComponent = {};
213
274
  * @final
214
275
  * @protected
215
276
  */
216
- ReactComponent.prototype.setState = function (partialState, callback) {
277
+ Component.prototype.setState = function (partialState, callback) {
217
278
  !(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;
218
279
  this.updater.enqueueSetState(this, partialState, callback, 'setState');
219
280
  };
@@ -232,7 +293,7 @@ ReactComponent.prototype.setState = function (partialState, callback) {
232
293
  * @final
233
294
  * @protected
234
295
  */
235
- ReactComponent.prototype.forceUpdate = function (callback) {
296
+ Component.prototype.forceUpdate = function (callback) {
236
297
  this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
237
298
  };
238
299
 
@@ -247,9 +308,9 @@ ReactComponent.prototype.forceUpdate = function (callback) {
247
308
  replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
248
309
  };
249
310
  var defineDeprecationWarning = function (methodName, info) {
250
- Object.defineProperty(ReactComponent.prototype, methodName, {
311
+ Object.defineProperty(Component.prototype, methodName, {
251
312
  get: function () {
252
- lowPriorityWarning_1(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
313
+ lowPriorityWarning$1(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
253
314
  return undefined;
254
315
  }
255
316
  });
@@ -264,59 +325,43 @@ ReactComponent.prototype.forceUpdate = function (callback) {
264
325
  /**
265
326
  * Base class helpers for the updating state of a component.
266
327
  */
267
- function ReactPureComponent(props, context, updater) {
268
- // Duplicated from ReactComponent.
328
+ function PureComponent(props, context, updater) {
329
+ // Duplicated from Component.
269
330
  this.props = props;
270
331
  this.context = context;
271
332
  this.refs = emptyObject;
272
333
  // We initialize the default updater but the real one gets injected by the
273
334
  // renderer.
274
- this.updater = updater || ReactNoopUpdateQueue_1;
335
+ this.updater = updater || ReactNoopUpdateQueue;
275
336
  }
276
337
 
277
338
  function ComponentDummy() {}
278
- ComponentDummy.prototype = ReactComponent.prototype;
279
- var pureComponentPrototype = ReactPureComponent.prototype = new ComponentDummy();
280
- pureComponentPrototype.constructor = ReactPureComponent;
339
+ ComponentDummy.prototype = Component.prototype;
340
+ var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
341
+ pureComponentPrototype.constructor = PureComponent;
281
342
  // Avoid an extra prototype jump for these methods.
282
- objectAssign$1(pureComponentPrototype, ReactComponent.prototype);
343
+ _assign(pureComponentPrototype, Component.prototype);
283
344
  pureComponentPrototype.isPureReactComponent = true;
284
345
 
285
- function ReactAsyncComponent(props, context, updater) {
286
- // Duplicated from ReactComponent.
346
+ function AsyncComponent(props, context, updater) {
347
+ // Duplicated from Component.
287
348
  this.props = props;
288
349
  this.context = context;
289
350
  this.refs = emptyObject;
290
351
  // We initialize the default updater but the real one gets injected by the
291
352
  // renderer.
292
- this.updater = updater || ReactNoopUpdateQueue_1;
353
+ this.updater = updater || ReactNoopUpdateQueue;
293
354
  }
294
355
 
295
- var asyncComponentPrototype = ReactAsyncComponent.prototype = new ComponentDummy();
296
- asyncComponentPrototype.constructor = ReactAsyncComponent;
356
+ var asyncComponentPrototype = AsyncComponent.prototype = new ComponentDummy();
357
+ asyncComponentPrototype.constructor = AsyncComponent;
297
358
  // Avoid an extra prototype jump for these methods.
298
- objectAssign$1(asyncComponentPrototype, ReactComponent.prototype);
359
+ _assign(asyncComponentPrototype, Component.prototype);
299
360
  asyncComponentPrototype.unstable_isAsyncReactComponent = true;
300
361
  asyncComponentPrototype.render = function () {
301
362
  return this.props.children;
302
363
  };
303
364
 
304
- var ReactBaseClasses = {
305
- Component: ReactComponent,
306
- PureComponent: ReactPureComponent,
307
- AsyncComponent: ReactAsyncComponent
308
- };
309
-
310
- /**
311
- * Copyright (c) 2013-present, Facebook, Inc.
312
- *
313
- * This source code is licensed under the MIT license found in the
314
- * LICENSE file in the root directory of this source tree.
315
- *
316
- * @providesModule ReactCurrentOwner
317
- *
318
- */
319
-
320
365
  /**
321
366
  * Keeps track of the current owner.
322
367
  *
@@ -329,16 +374,24 @@ var ReactCurrentOwner = {
329
374
  * @type {ReactComponent}
330
375
  */
331
376
  current: null
332
- };
377
+ }; /**
378
+ * Copyright (c) 2013-present, Facebook, Inc.
379
+ *
380
+ * This source code is licensed under the MIT license found in the
381
+ * LICENSE file in the root directory of this source tree.
382
+ *
383
+ *
384
+ */
333
385
 
334
- var ReactCurrentOwner_1 = ReactCurrentOwner;
386
+ /**
387
+ * Copyright (c) 2014-present, Facebook, Inc.
388
+ *
389
+ * This source code is licensed under the MIT license found in the
390
+ * LICENSE file in the root directory of this source tree.
391
+ */
335
392
 
336
393
  var hasOwnProperty = Object.prototype.hasOwnProperty;
337
394
 
338
- {
339
- var warning$2 = require$$0;
340
- }
341
-
342
395
  // The Symbol used to tag the ReactElement type. If there is no native Symbol
343
396
  // nor polyfill, then a plain number is used for performance.
344
397
  var REACT_ELEMENT_TYPE$1 = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
@@ -381,7 +434,7 @@ function defineKeyPropWarningGetter(props, displayName) {
381
434
  var warnAboutAccessingKey = function () {
382
435
  if (!specialPropKeyWarningShown) {
383
436
  specialPropKeyWarningShown = true;
384
- warning$2(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
437
+ warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
385
438
  }
386
439
  };
387
440
  warnAboutAccessingKey.isReactWarning = true;
@@ -395,7 +448,7 @@ function defineRefPropWarningGetter(props, displayName) {
395
448
  var warnAboutAccessingRef = function () {
396
449
  if (!specialPropRefWarningShown) {
397
450
  specialPropRefWarningShown = true;
398
- warning$2(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
451
+ warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
399
452
  }
400
453
  };
401
454
  warnAboutAccessingRef.isReactWarning = true;
@@ -483,9 +536,9 @@ var ReactElement = function (type, key, ref, self, source, owner, props) {
483
536
 
484
537
  /**
485
538
  * Create and return a new ReactElement of the given type.
486
- * See https://facebook.github.io/react/docs/react-api.html#createelement
539
+ * See https://reactjs.org/docs/react-api.html#createelement
487
540
  */
488
- ReactElement.createElement = function (type, config, children) {
541
+ function createElement(type, config, children) {
489
542
  var propName;
490
543
 
491
544
  // Reserved names are extracted
@@ -554,39 +607,30 @@ ReactElement.createElement = function (type, config, children) {
554
607
  }
555
608
  }
556
609
  }
557
- return ReactElement(type, key, ref, self, source, ReactCurrentOwner_1.current, props);
558
- };
610
+ return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
611
+ }
559
612
 
560
613
  /**
561
614
  * Return a function that produces ReactElements of a given type.
562
- * See https://facebook.github.io/react/docs/react-api.html#createfactory
615
+ * See https://reactjs.org/docs/react-api.html#createfactory
563
616
  */
564
- ReactElement.createFactory = function (type) {
565
- var factory = ReactElement.createElement.bind(null, type);
566
- // Expose the type on the factory and the prototype so that it can be
567
- // easily accessed on elements. E.g. `<Foo />.type === Foo`.
568
- // This should not be named `constructor` since this may not be the function
569
- // that created the element, and it may not even be a constructor.
570
- // Legacy hook TODO: Warn if this is accessed
571
- factory.type = type;
572
- return factory;
573
- };
574
617
 
575
- ReactElement.cloneAndReplaceKey = function (oldElement, newKey) {
618
+
619
+ function cloneAndReplaceKey(oldElement, newKey) {
576
620
  var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
577
621
 
578
622
  return newElement;
579
- };
623
+ }
580
624
 
581
625
  /**
582
626
  * Clone and return a new ReactElement using element as the starting point.
583
- * See https://facebook.github.io/react/docs/react-api.html#cloneelement
627
+ * See https://reactjs.org/docs/react-api.html#cloneelement
584
628
  */
585
- ReactElement.cloneElement = function (element, config, children) {
629
+ function cloneElement(element, config, children) {
586
630
  var propName;
587
631
 
588
632
  // Original props are copied
589
- var props = objectAssign$1({}, element.props);
633
+ var props = _assign({}, element.props);
590
634
 
591
635
  // Reserved names are extracted
592
636
  var key = element.key;
@@ -605,7 +649,7 @@ ReactElement.cloneElement = function (element, config, children) {
605
649
  if (hasValidRef(config)) {
606
650
  // Silently steal the ref from the parent.
607
651
  ref = config.ref;
608
- owner = ReactCurrentOwner_1.current;
652
+ owner = ReactCurrentOwner.current;
609
653
  }
610
654
  if (hasValidKey(config)) {
611
655
  key = '' + config.key;
@@ -642,20 +686,18 @@ ReactElement.cloneElement = function (element, config, children) {
642
686
  }
643
687
 
644
688
  return ReactElement(element.type, key, ref, self, source, owner, props);
645
- };
689
+ }
646
690
 
647
691
  /**
648
692
  * Verifies the object is a ReactElement.
649
- * See https://facebook.github.io/react/docs/react-api.html#isvalidelement
693
+ * See https://reactjs.org/docs/react-api.html#isvalidelement
650
694
  * @param {?object} object
651
695
  * @return {boolean} True if `object` is a valid component.
652
696
  * @final
653
697
  */
654
- ReactElement.isValidElement = function (object) {
698
+ function isValidElement(object) {
655
699
  return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE$1;
656
- };
657
-
658
- var ReactElement_1 = ReactElement;
700
+ }
659
701
 
660
702
  /**
661
703
  * Copyright (c) 2013-present, Facebook, Inc.
@@ -663,7 +705,6 @@ var ReactElement_1 = ReactElement;
663
705
  * This source code is licensed under the MIT license found in the
664
706
  * LICENSE file in the root directory of this source tree.
665
707
  *
666
- * @providesModule ReactDebugCurrentFrame
667
708
  *
668
709
  */
669
710
 
@@ -682,21 +723,19 @@ var ReactDebugCurrentFrame = {};
682
723
  };
683
724
  }
684
725
 
685
- var ReactDebugCurrentFrame_1 = ReactDebugCurrentFrame;
686
-
687
- {
688
- var warning$1 = require$$0;
689
-
690
- var _require = ReactDebugCurrentFrame_1,
691
- getStackAddendum = _require.getStackAddendum;
692
- }
726
+ /**
727
+ * Copyright (c) 2013-present, Facebook, Inc.
728
+ *
729
+ * This source code is licensed under the MIT license found in the
730
+ * LICENSE file in the root directory of this source tree.
731
+ */
693
732
 
694
733
  var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
695
734
  var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
696
735
  // The Symbol used to tag the ReactElement type. If there is no native Symbol
697
736
  // nor polyfill, then a plain number is used for performance.
698
737
  var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
699
-
738
+ var REACT_PORTAL_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.portal') || 0xeaca;
700
739
  var SEPARATOR = '.';
701
740
  var SUBSEPARATOR = ':';
702
741
 
@@ -783,7 +822,7 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
783
822
  if (children === null || type === 'string' || type === 'number' ||
784
823
  // The following is inlined from ReactElement. This means we can optimize
785
824
  // some checks. React Fiber also inlines this logic for similar purposes.
786
- type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) {
825
+ type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE || type === 'object' && children.$$typeof === REACT_PORTAL_TYPE) {
787
826
  callback(traverseContext, children,
788
827
  // If it's the only child, treat the name as if it was wrapped in an array
789
828
  // so that it's consistent if the number of children grows.
@@ -808,7 +847,7 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
808
847
  {
809
848
  // Warn about using Maps as children
810
849
  if (iteratorFn === children.entries) {
811
- warning$1(didWarnAboutMaps, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.%s', getStackAddendum());
850
+ warning(didWarnAboutMaps, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.%s', ReactDebugCurrentFrame.getStackAddendum());
812
851
  didWarnAboutMaps = true;
813
852
  }
814
853
  }
@@ -824,7 +863,7 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
824
863
  } else if (type === 'object') {
825
864
  var addendum = '';
826
865
  {
827
- addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + getStackAddendum();
866
+ addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum();
828
867
  }
829
868
  var childrenString = '' + children;
830
869
  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);
@@ -886,7 +925,7 @@ function forEachSingleChild(bookKeeping, child, name) {
886
925
  /**
887
926
  * Iterates through children that are typically specified as `props.children`.
888
927
  *
889
- * See https://facebook.github.io/react/docs/react-api.html#react.children.foreach
928
+ * See https://reactjs.org/docs/react-api.html#react.children.foreach
890
929
  *
891
930
  * The provided forEachFunc(child, index) will be called for each
892
931
  * leaf child.
@@ -915,8 +954,8 @@ function mapSingleChildIntoContext(bookKeeping, child, childKey) {
915
954
  if (Array.isArray(mappedChild)) {
916
955
  mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument);
917
956
  } else if (mappedChild != null) {
918
- if (ReactElement_1.isValidElement(mappedChild)) {
919
- mappedChild = ReactElement_1.cloneAndReplaceKey(mappedChild,
957
+ if (isValidElement(mappedChild)) {
958
+ mappedChild = cloneAndReplaceKey(mappedChild,
920
959
  // Keep both the (mapped) and old keys if they differ, just as
921
960
  // traverseAllChildren used to do for objects as children
922
961
  keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
@@ -938,7 +977,7 @@ function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
938
977
  /**
939
978
  * Maps children that are typically specified as `props.children`.
940
979
  *
941
- * See https://facebook.github.io/react/docs/react-api.html#react.children.map
980
+ * See https://reactjs.org/docs/react-api.html#react.children.map
942
981
  *
943
982
  * The provided mapFunction(child, key, index) will be called for each
944
983
  * leaf child.
@@ -961,7 +1000,7 @@ function mapChildren(children, func, context) {
961
1000
  * Count the number of children that are typically specified as
962
1001
  * `props.children`.
963
1002
  *
964
- * See https://facebook.github.io/react/docs/react-api.html#react.children.count
1003
+ * See https://reactjs.org/docs/react-api.html#react.children.count
965
1004
  *
966
1005
  * @param {?*} children Children tree container.
967
1006
  * @return {number} The number of children.
@@ -974,7 +1013,7 @@ function countChildren(children, context) {
974
1013
  * Flatten a children object (typically specified as `props.children`) and
975
1014
  * return an array with appropriately re-keyed children.
976
1015
  *
977
- * See https://facebook.github.io/react/docs/react-api.html#react.children.toarray
1016
+ * See https://reactjs.org/docs/react-api.html#react.children.toarray
978
1017
  */
979
1018
  function toArray(children) {
980
1019
  var result = [];
@@ -982,31 +1021,11 @@ function toArray(children) {
982
1021
  return result;
983
1022
  }
984
1023
 
985
- var ReactChildren = {
986
- forEach: forEachChildren,
987
- map: mapChildren,
988
- count: countChildren,
989
- toArray: toArray
990
- };
991
-
992
- var ReactChildren_1 = ReactChildren;
993
-
994
- /**
995
- * Copyright (c) 2013-present, Facebook, Inc.
996
- *
997
- * This source code is licensed under the MIT license found in the
998
- * LICENSE file in the root directory of this source tree.
999
- *
1000
- * @providesModule ReactVersion
1001
- */
1002
-
1003
- var ReactVersion = '16.0.0';
1004
-
1005
1024
  /**
1006
1025
  * Returns the first child in a collection of children and verifies that there
1007
1026
  * is only one child in the collection.
1008
1027
  *
1009
- * See https://facebook.github.io/react/docs/react-api.html#react.children.only
1028
+ * See https://reactjs.org/docs/react-api.html#react.children.only
1010
1029
  *
1011
1030
  * The current implementation of this function assumes that a single child gets
1012
1031
  * passed without a wrapper, but the purpose of this helper function is to
@@ -1017,12 +1036,10 @@ var ReactVersion = '16.0.0';
1017
1036
  * structure.
1018
1037
  */
1019
1038
  function onlyChild(children) {
1020
- !ReactElement_1.isValidElement(children) ? invariant(false, 'React.Children.only expected to receive a single React element child.') : void 0;
1039
+ !isValidElement(children) ? invariant(false, 'React.Children.only expected to receive a single React element child.') : void 0;
1021
1040
  return children;
1022
1041
  }
1023
1042
 
1024
- var onlyChild_1 = onlyChild;
1025
-
1026
1043
  /**
1027
1044
  * Copyright (c) 2016-present, Facebook, Inc.
1028
1045
  *
@@ -1030,54 +1047,46 @@ var onlyChild_1 = onlyChild;
1030
1047
  * LICENSE file in the root directory of this source tree.
1031
1048
  *
1032
1049
  *
1033
- * @providesModule describeComponentFrame
1034
1050
  */
1035
1051
 
1036
- var describeComponentFrame$1 = function (name, source, ownerName) {
1052
+ var describeComponentFrame = function (name, source, ownerName) {
1037
1053
  return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
1038
1054
  };
1039
1055
 
1056
+ function getComponentName(fiber) {
1057
+ var type = fiber.type;
1058
+
1059
+ if (typeof type === 'string') {
1060
+ return type;
1061
+ }
1062
+ if (typeof type === 'function') {
1063
+ return type.displayName || type.name;
1064
+ }
1065
+ return null;
1066
+ } /**
1067
+ * Copyright (c) 2013-present, Facebook, Inc.
1068
+ *
1069
+ * This source code is licensed under the MIT license found in the
1070
+ * LICENSE file in the root directory of this source tree.
1071
+ *
1072
+ *
1073
+ */
1074
+
1040
1075
  /**
1041
- * Copyright (c) 2013-present, Facebook, Inc.
1076
+ * Copyright (c) 2014-present, Facebook, Inc.
1042
1077
  *
1043
1078
  * This source code is licensed under the MIT license found in the
1044
1079
  * LICENSE file in the root directory of this source tree.
1045
- *
1046
- * @providesModule getComponentName
1047
- *
1048
1080
  */
1049
1081
 
1050
- function getComponentName$1(instanceOrFiber) {
1051
- if (typeof instanceOrFiber.getName === 'function') {
1052
- // Stack reconciler
1053
- var instance = instanceOrFiber;
1054
- return instance.getName();
1055
- }
1056
- if (typeof instanceOrFiber.tag === 'number') {
1057
- // Fiber reconciler
1058
- var fiber = instanceOrFiber;
1059
- var type = fiber.type;
1060
-
1061
- if (typeof type === 'string') {
1062
- return type;
1063
- }
1064
- if (typeof type === 'function') {
1065
- return type.displayName || type.name;
1066
- }
1067
- }
1068
- return null;
1069
- }
1070
-
1071
- var getComponentName_1 = getComponentName$1;
1082
+ /**
1083
+ * ReactElementValidator provides a wrapper around a element factory
1084
+ * which validates the props passed to the element. This is intended to be
1085
+ * used only in DEV and could be replaced by a static type checker for languages
1086
+ * that support it.
1087
+ */
1072
1088
 
1073
1089
  {
1074
- var checkPropTypes$1 = checkPropTypes;
1075
- var lowPriorityWarning$1 = lowPriorityWarning_1;
1076
- var ReactDebugCurrentFrame$1 = ReactDebugCurrentFrame_1;
1077
- var warning$3 = require$$0;
1078
- var describeComponentFrame = describeComponentFrame$1;
1079
- var getComponentName = getComponentName_1;
1080
-
1081
1090
  var currentlyValidatingElement = null;
1082
1091
 
1083
1092
  var getDisplayName = function (element) {
@@ -1087,29 +1096,35 @@ var getComponentName_1 = getComponentName$1;
1087
1096
  return '#text';
1088
1097
  } else if (typeof element.type === 'string') {
1089
1098
  return element.type;
1099
+ } else if (element.type === REACT_FRAGMENT_TYPE$1) {
1100
+ return 'React.Fragment';
1090
1101
  } else {
1091
1102
  return element.type.displayName || element.type.name || 'Unknown';
1092
1103
  }
1093
1104
  };
1094
1105
 
1095
- var getStackAddendum$1 = function () {
1106
+ var getStackAddendum = function () {
1096
1107
  var stack = '';
1097
1108
  if (currentlyValidatingElement) {
1098
1109
  var name = getDisplayName(currentlyValidatingElement);
1099
1110
  var owner = currentlyValidatingElement._owner;
1100
1111
  stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner));
1101
1112
  }
1102
- stack += ReactDebugCurrentFrame$1.getStackAddendum() || '';
1113
+ stack += ReactDebugCurrentFrame.getStackAddendum() || '';
1103
1114
  return stack;
1104
1115
  };
1116
+
1117
+ var REACT_FRAGMENT_TYPE$1 = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.fragment') || 0xeacb;
1118
+
1119
+ var VALID_FRAGMENT_PROPS = new Map([['children', true], ['key', true]]);
1105
1120
  }
1106
1121
 
1107
1122
  var ITERATOR_SYMBOL$1 = typeof Symbol === 'function' && Symbol.iterator;
1108
1123
  var FAUX_ITERATOR_SYMBOL$1 = '@@iterator'; // Before Symbol spec.
1109
1124
 
1110
1125
  function getDeclarationErrorAddendum() {
1111
- if (ReactCurrentOwner_1.current) {
1112
- var name = getComponentName(ReactCurrentOwner_1.current);
1126
+ if (ReactCurrentOwner.current) {
1127
+ var name = getComponentName(ReactCurrentOwner.current);
1113
1128
  if (name) {
1114
1129
  return '\n\nCheck the render method of `' + name + '`.';
1115
1130
  }
@@ -1173,14 +1188,14 @@ function validateExplicitKey(element, parentType) {
1173
1188
  // property, it may be the creator of the child that's responsible for
1174
1189
  // assigning it a key.
1175
1190
  var childOwner = '';
1176
- if (element && element._owner && element._owner !== ReactCurrentOwner_1.current) {
1191
+ if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
1177
1192
  // Give the component that originally created this child.
1178
1193
  childOwner = ' It was passed a child from ' + getComponentName(element._owner) + '.';
1179
1194
  }
1180
1195
 
1181
1196
  currentlyValidatingElement = element;
1182
1197
  {
1183
- warning$3(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, getStackAddendum$1());
1198
+ warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, getStackAddendum());
1184
1199
  }
1185
1200
  currentlyValidatingElement = null;
1186
1201
  }
@@ -1201,11 +1216,11 @@ function validateChildKeys(node, parentType) {
1201
1216
  if (Array.isArray(node)) {
1202
1217
  for (var i = 0; i < node.length; i++) {
1203
1218
  var child = node[i];
1204
- if (ReactElement_1.isValidElement(child)) {
1219
+ if (isValidElement(child)) {
1205
1220
  validateExplicitKey(child, parentType);
1206
1221
  }
1207
1222
  }
1208
- } else if (ReactElement_1.isValidElement(node)) {
1223
+ } else if (isValidElement(node)) {
1209
1224
  // This element was passed in a valid location.
1210
1225
  if (node._store) {
1211
1226
  node._store.validated = true;
@@ -1219,7 +1234,7 @@ function validateChildKeys(node, parentType) {
1219
1234
  var iterator = iteratorFn.call(node);
1220
1235
  var step;
1221
1236
  while (!(step = iterator.next()).done) {
1222
- if (ReactElement_1.isValidElement(step.value)) {
1237
+ if (isValidElement(step.value)) {
1223
1238
  validateExplicitKey(step.value, parentType);
1224
1239
  }
1225
1240
  }
@@ -1244,455 +1259,212 @@ function validatePropTypes(element) {
1244
1259
 
1245
1260
  if (propTypes) {
1246
1261
  currentlyValidatingElement = element;
1247
- checkPropTypes$1(propTypes, element.props, 'prop', name, getStackAddendum$1);
1262
+ checkPropTypes(propTypes, element.props, 'prop', name, getStackAddendum);
1248
1263
  currentlyValidatingElement = null;
1249
1264
  }
1250
1265
  if (typeof componentClass.getDefaultProps === 'function') {
1251
- warning$3(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
1266
+ warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
1252
1267
  }
1253
1268
  }
1254
1269
 
1255
- var ReactElementValidator$1 = {
1256
- createElement: function (type, props, children) {
1257
- var validType = typeof type === 'string' || typeof type === 'function';
1258
- // We warn in this case but don't throw. We expect the element creation to
1259
- // succeed and there will likely be errors in render.
1260
- if (!validType) {
1261
- var info = '';
1262
- if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
1263
- info += ' You likely forgot to export your component from the file ' + "it's defined in.";
1264
- }
1265
-
1266
- var sourceInfo = getSourceInfoErrorAddendum(props);
1267
- if (sourceInfo) {
1268
- info += sourceInfo;
1269
- } else {
1270
- info += getDeclarationErrorAddendum();
1271
- }
1272
-
1273
- info += ReactDebugCurrentFrame$1.getStackAddendum() || '';
1270
+ /**
1271
+ * Given a fragment, validate that it can only be provided with fragment props
1272
+ * @param {ReactElement} fragment
1273
+ */
1274
+ function validateFragmentProps(fragment) {
1275
+ currentlyValidatingElement = fragment;
1274
1276
 
1275
- warning$3(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', type == null ? type : typeof type, info);
1276
- }
1277
+ var _iteratorNormalCompletion = true;
1278
+ var _didIteratorError = false;
1279
+ var _iteratorError = undefined;
1277
1280
 
1278
- var element = ReactElement_1.createElement.apply(this, arguments);
1281
+ try {
1282
+ for (var _iterator = Object.keys(fragment.props)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
1283
+ var key = _step.value;
1279
1284
 
1280
- // The result can be nullish if a mock or a custom function is used.
1281
- // TODO: Drop this when these are no longer allowed as the type argument.
1282
- if (element == null) {
1283
- return element;
1285
+ if (!VALID_FRAGMENT_PROPS.has(key)) {
1286
+ warning(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.%s', key, getStackAddendum());
1287
+ break;
1288
+ }
1284
1289
  }
1285
-
1286
- // Skip key warning if the type isn't valid since our key validation logic
1287
- // doesn't expect a non-string/function type and can throw confusing errors.
1288
- // We don't want exception behavior to differ between dev and prod.
1289
- // (Rendering will throw with a helpful message and as soon as the type is
1290
- // fixed, the key warnings will appear.)
1291
- if (validType) {
1292
- for (var i = 2; i < arguments.length; i++) {
1293
- validateChildKeys(arguments[i], type);
1290
+ } catch (err) {
1291
+ _didIteratorError = true;
1292
+ _iteratorError = err;
1293
+ } finally {
1294
+ try {
1295
+ if (!_iteratorNormalCompletion && _iterator['return']) {
1296
+ _iterator['return']();
1297
+ }
1298
+ } finally {
1299
+ if (_didIteratorError) {
1300
+ throw _iteratorError;
1294
1301
  }
1295
1302
  }
1303
+ }
1296
1304
 
1297
- validatePropTypes(element);
1298
-
1299
- return element;
1300
- },
1305
+ if (fragment.ref !== null) {
1306
+ warning(false, 'Invalid attribute `ref` supplied to `React.Fragment`.%s', getStackAddendum());
1307
+ }
1301
1308
 
1302
- createFactory: function (type) {
1303
- var validatedFactory = ReactElementValidator$1.createElement.bind(null, type);
1304
- // Legacy hook TODO: Warn if this is accessed
1305
- validatedFactory.type = type;
1309
+ currentlyValidatingElement = null;
1310
+ }
1306
1311
 
1307
- {
1308
- Object.defineProperty(validatedFactory, 'type', {
1309
- enumerable: false,
1310
- get: function () {
1311
- lowPriorityWarning$1(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
1312
- Object.defineProperty(this, 'type', {
1313
- value: type
1314
- });
1315
- return type;
1316
- }
1317
- });
1312
+ function createElementWithValidation(type, props, children) {
1313
+ var validType = typeof type === 'string' || typeof type === 'function' || typeof type === 'symbol' || typeof type === 'number';
1314
+ // We warn in this case but don't throw. We expect the element creation to
1315
+ // succeed and there will likely be errors in render.
1316
+ if (!validType) {
1317
+ var info = '';
1318
+ if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
1319
+ info += ' You likely forgot to export your component from the file ' + "it's defined in.";
1318
1320
  }
1319
1321
 
1320
- return validatedFactory;
1321
- },
1322
-
1323
- cloneElement: function (element, props, children) {
1324
- var newElement = ReactElement_1.cloneElement.apply(this, arguments);
1325
- for (var i = 2; i < arguments.length; i++) {
1326
- validateChildKeys(arguments[i], newElement.type);
1322
+ var sourceInfo = getSourceInfoErrorAddendum(props);
1323
+ if (sourceInfo) {
1324
+ info += sourceInfo;
1325
+ } else {
1326
+ info += getDeclarationErrorAddendum();
1327
1327
  }
1328
- validatePropTypes(newElement);
1329
- return newElement;
1330
- }
1331
- };
1332
1328
 
1333
- var ReactElementValidator_1 = ReactElementValidator$1;
1329
+ info += getStackAddendum() || '';
1334
1330
 
1335
- {
1336
- var warning$4 = require$$0;
1337
- }
1338
-
1339
- function isNative(fn) {
1340
- // Based on isNative() from Lodash
1341
- var funcToString = Function.prototype.toString;
1342
- var reIsNative = RegExp('^' + funcToString
1343
- // Take an example native function source for comparison
1344
- .call(Object.prototype.hasOwnProperty)
1345
- // Strip regex characters so we can use it for regex
1346
- .replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
1347
- // Remove hasOwnProperty from the template to make it generic
1348
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
1349
- try {
1350
- var source = funcToString.call(fn);
1351
- return reIsNative.test(source);
1352
- } catch (err) {
1353
- return false;
1331
+ warning(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', type == null ? type : typeof type, info);
1354
1332
  }
1355
- }
1356
-
1357
- var canUseCollections =
1358
- // Array.from
1359
- typeof Array.from === 'function' &&
1360
- // Map
1361
- typeof Map === 'function' && isNative(Map) &&
1362
- // Map.prototype.keys
1363
- Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) &&
1364
- // Set
1365
- typeof Set === 'function' && isNative(Set) &&
1366
- // Set.prototype.keys
1367
- Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys);
1368
-
1369
- var setItem;
1370
- var getItem;
1371
- var removeItem;
1372
- var getItemIDs;
1373
- var addRoot;
1374
- var removeRoot;
1375
- var getRootIDs;
1376
-
1377
- if (canUseCollections) {
1378
- var itemMap = new Map();
1379
- var rootIDSet = new Set();
1380
-
1381
- setItem = function (id, item) {
1382
- itemMap.set(id, item);
1383
- };
1384
- getItem = function (id) {
1385
- return itemMap.get(id);
1386
- };
1387
- removeItem = function (id) {
1388
- itemMap['delete'](id);
1389
- };
1390
- getItemIDs = function () {
1391
- return Array.from(itemMap.keys());
1392
- };
1393
1333
 
1394
- addRoot = function (id) {
1395
- rootIDSet.add(id);
1396
- };
1397
- removeRoot = function (id) {
1398
- rootIDSet['delete'](id);
1399
- };
1400
- getRootIDs = function () {
1401
- return Array.from(rootIDSet.keys());
1402
- };
1403
- } else {
1404
- var itemByKey = {};
1405
- var rootByKey = {};
1406
-
1407
- // Use non-numeric keys to prevent V8 performance issues:
1408
- // https://github.com/facebook/react/pull/7232
1409
- var getKeyFromID = function (id) {
1410
- return '.' + id;
1411
- };
1412
- var getIDFromKey = function (key) {
1413
- return parseInt(key.substr(1), 10);
1414
- };
1415
-
1416
- setItem = function (id, item) {
1417
- var key = getKeyFromID(id);
1418
- itemByKey[key] = item;
1419
- };
1420
- getItem = function (id) {
1421
- var key = getKeyFromID(id);
1422
- return itemByKey[key];
1423
- };
1424
- removeItem = function (id) {
1425
- var key = getKeyFromID(id);
1426
- delete itemByKey[key];
1427
- };
1428
- getItemIDs = function () {
1429
- return Object.keys(itemByKey).map(getIDFromKey);
1430
- };
1431
-
1432
- addRoot = function (id) {
1433
- var key = getKeyFromID(id);
1434
- rootByKey[key] = true;
1435
- };
1436
- removeRoot = function (id) {
1437
- var key = getKeyFromID(id);
1438
- delete rootByKey[key];
1439
- };
1440
- getRootIDs = function () {
1441
- return Object.keys(rootByKey).map(getIDFromKey);
1442
- };
1443
- }
1334
+ var element = createElement.apply(this, arguments);
1444
1335
 
1445
- var unmountedIDs = [];
1446
-
1447
- function purgeDeep(id) {
1448
- var item = getItem(id);
1449
- if (item) {
1450
- var childIDs = item.childIDs;
1336
+ // The result can be nullish if a mock or a custom function is used.
1337
+ // TODO: Drop this when these are no longer allowed as the type argument.
1338
+ if (element == null) {
1339
+ return element;
1340
+ }
1451
1341
 
1452
- removeItem(id);
1453
- childIDs.forEach(purgeDeep);
1342
+ // Skip key warning if the type isn't valid since our key validation logic
1343
+ // doesn't expect a non-string/function type and can throw confusing errors.
1344
+ // We don't want exception behavior to differ between dev and prod.
1345
+ // (Rendering will throw with a helpful message and as soon as the type is
1346
+ // fixed, the key warnings will appear.)
1347
+ if (validType) {
1348
+ for (var i = 2; i < arguments.length; i++) {
1349
+ validateChildKeys(arguments[i], type);
1350
+ }
1454
1351
  }
1455
- }
1456
1352
 
1457
- function getDisplayName$1(element) {
1458
- if (element == null) {
1459
- return '#empty';
1460
- } else if (typeof element === 'string' || typeof element === 'number') {
1461
- return '#text';
1462
- } else if (typeof element.type === 'string') {
1463
- return element.type;
1353
+ if (typeof type === 'symbol' && type === REACT_FRAGMENT_TYPE$1) {
1354
+ validateFragmentProps(element);
1464
1355
  } else {
1465
- return element.type.displayName || element.type.name || 'Unknown';
1356
+ validatePropTypes(element);
1466
1357
  }
1467
- }
1468
-
1469
- function describeID(id) {
1470
- var name = ReactComponentTreeHook.getDisplayName(id);
1471
- var element = ReactComponentTreeHook.getElement(id);
1472
- var ownerID = ReactComponentTreeHook.getOwnerID(id);
1473
- var ownerName = void 0;
1474
1358
 
1475
- if (ownerID) {
1476
- ownerName = ReactComponentTreeHook.getDisplayName(ownerID);
1477
- }
1478
- warning$4(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id);
1479
- return describeComponentFrame$1(name || '', element && element._source, ownerName || '');
1359
+ return element;
1480
1360
  }
1481
1361
 
1482
- var ReactComponentTreeHook = {
1483
- onSetChildren: function (id, nextChildIDs) {
1484
- var item = getItem(id);
1485
- !item ? invariant(false, 'Item must have been set') : void 0;
1486
- item.childIDs = nextChildIDs;
1487
-
1488
- for (var i = 0; i < nextChildIDs.length; i++) {
1489
- var nextChildID = nextChildIDs[i];
1490
- var nextChild = getItem(nextChildID);
1491
- !nextChild ? invariant(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : void 0;
1492
- !(nextChild.childIDs != null || typeof nextChild.element !== 'object' || nextChild.element == null) ? invariant(false, 'Expected onSetChildren() to fire for a container child before its parent includes it in onSetChildren().') : void 0;
1493
- !nextChild.isMounted ? invariant(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : void 0;
1494
- if (nextChild.parentID == null) {
1495
- nextChild.parentID = id;
1496
- // TODO: This shouldn't be necessary but mounting a new root during in
1497
- // componentWillMount currently causes not-yet-mounted components to
1498
- // be purged from our tree data so their parent id is missing.
1499
- }
1500
- !(nextChild.parentID === id) ? invariant(false, 'Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (%s has parents %s and %s).', nextChildID, nextChild.parentID, id) : void 0;
1501
- }
1502
- },
1503
- onBeforeMountComponent: function (id, element, parentID) {
1504
- var item = {
1505
- element: element,
1506
- parentID: parentID,
1507
- text: null,
1508
- childIDs: [],
1509
- isMounted: false,
1510
- updateCount: 0
1511
- };
1512
- setItem(id, item);
1513
- },
1514
- onBeforeUpdateComponent: function (id, element) {
1515
- var item = getItem(id);
1516
- if (!item || !item.isMounted) {
1517
- // We may end up here as a result of setState() in componentWillUnmount().
1518
- // In this case, ignore the element.
1519
- return;
1520
- }
1521
- item.element = element;
1522
- },
1523
- onMountComponent: function (id) {
1524
- var item = getItem(id);
1525
- !item ? invariant(false, 'Item must have been set') : void 0;
1526
- item.isMounted = true;
1527
- var isRoot = item.parentID === 0;
1528
- if (isRoot) {
1529
- addRoot(id);
1530
- }
1531
- },
1532
- onUpdateComponent: function (id) {
1533
- var item = getItem(id);
1534
- if (!item || !item.isMounted) {
1535
- // We may end up here as a result of setState() in componentWillUnmount().
1536
- // In this case, ignore the element.
1537
- return;
1538
- }
1539
- item.updateCount++;
1540
- },
1541
- onUnmountComponent: function (id) {
1542
- var item = getItem(id);
1543
- if (item) {
1544
- // We need to check if it exists.
1545
- // `item` might not exist if it is inside an error boundary, and a sibling
1546
- // error boundary child threw while mounting. Then this instance never
1547
- // got a chance to mount, but it still gets an unmounting event during
1548
- // the error boundary cleanup.
1549
- item.isMounted = false;
1550
- var isRoot = item.parentID === 0;
1551
- if (isRoot) {
1552
- removeRoot(id);
1553
- }
1554
- }
1555
- unmountedIDs.push(id);
1556
- },
1557
- purgeUnmountedComponents: function () {
1558
- if (ReactComponentTreeHook._preventPurging) {
1559
- // Should only be used for testing.
1560
- return;
1561
- }
1362
+ function createFactoryWithValidation(type) {
1363
+ var validatedFactory = createElementWithValidation.bind(null, type);
1364
+ // Legacy hook TODO: Warn if this is accessed
1365
+ validatedFactory.type = type;
1562
1366
 
1563
- for (var i = 0; i < unmountedIDs.length; i++) {
1564
- var id = unmountedIDs[i];
1565
- purgeDeep(id);
1566
- }
1567
- unmountedIDs.length = 0;
1568
- },
1569
- isMounted: function (id) {
1570
- var item = getItem(id);
1571
- return item ? item.isMounted : false;
1572
- },
1573
- getCurrentStackAddendum: function () {
1574
- var info = '';
1575
- var currentOwner = ReactCurrentOwner_1.current;
1576
- if (currentOwner) {
1577
- !(typeof currentOwner.tag !== 'number') ? invariant(false, 'Fiber owners should not show up in Stack stack traces.') : void 0;
1578
- if (typeof currentOwner._debugID === 'number') {
1579
- info += ReactComponentTreeHook.getStackAddendumByID(currentOwner._debugID);
1367
+ {
1368
+ Object.defineProperty(validatedFactory, 'type', {
1369
+ enumerable: false,
1370
+ get: function () {
1371
+ lowPriorityWarning$1(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
1372
+ Object.defineProperty(this, 'type', {
1373
+ value: type
1374
+ });
1375
+ return type;
1580
1376
  }
1581
- }
1582
- return info;
1583
- },
1584
- getStackAddendumByID: function (id) {
1585
- var info = '';
1586
- while (id) {
1587
- info += describeID(id);
1588
- id = ReactComponentTreeHook.getParentID(id);
1589
- }
1590
- return info;
1591
- },
1592
- getChildIDs: function (id) {
1593
- var item = getItem(id);
1594
- return item ? item.childIDs : [];
1595
- },
1596
- getDisplayName: function (id) {
1597
- var element = ReactComponentTreeHook.getElement(id);
1598
- if (!element) {
1599
- return null;
1600
- }
1601
- return getDisplayName$1(element);
1602
- },
1603
- getElement: function (id) {
1604
- var item = getItem(id);
1605
- return item ? item.element : null;
1606
- },
1607
- getOwnerID: function (id) {
1608
- var element = ReactComponentTreeHook.getElement(id);
1609
- if (!element || !element._owner) {
1610
- return null;
1611
- }
1612
- return element._owner._debugID;
1613
- },
1614
- getParentID: function (id) {
1615
- var item = getItem(id);
1616
- return item ? item.parentID : null;
1617
- },
1618
- getSource: function (id) {
1619
- var item = getItem(id);
1620
- var element = item ? item.element : null;
1621
- var source = element != null ? element._source : null;
1622
- return source;
1623
- },
1624
- getText: function (id) {
1625
- var element = ReactComponentTreeHook.getElement(id);
1626
- if (typeof element === 'string') {
1627
- return element;
1628
- } else if (typeof element === 'number') {
1629
- return '' + element;
1630
- } else {
1631
- return null;
1632
- }
1633
- },
1634
- getUpdateCount: function (id) {
1635
- var item = getItem(id);
1636
- return item ? item.updateCount : 0;
1637
- },
1638
-
1377
+ });
1378
+ }
1639
1379
 
1640
- getRootIDs: getRootIDs,
1641
- getRegisteredIDs: getItemIDs
1642
- };
1380
+ return validatedFactory;
1381
+ }
1643
1382
 
1644
- var ReactComponentTreeHook_1 = ReactComponentTreeHook;
1383
+ function cloneElementWithValidation(element, props, children) {
1384
+ var newElement = cloneElement.apply(this, arguments);
1385
+ for (var i = 2; i < arguments.length; i++) {
1386
+ validateChildKeys(arguments[i], newElement.type);
1387
+ }
1388
+ validatePropTypes(newElement);
1389
+ return newElement;
1390
+ }
1645
1391
 
1646
- var createElement = ReactElement_1.createElement;
1647
- var createFactory = ReactElement_1.createFactory;
1648
- var cloneElement = ReactElement_1.cloneElement;
1392
+ /**
1393
+ * Copyright (c) 2013-present, Facebook, Inc.
1394
+ *
1395
+ * This source code is licensed under the MIT license found in the
1396
+ * LICENSE file in the root directory of this source tree.
1397
+ */
1649
1398
 
1650
- {
1651
- var ReactElementValidator = ReactElementValidator_1;
1652
- createElement = ReactElementValidator.createElement;
1653
- createFactory = ReactElementValidator.createFactory;
1654
- cloneElement = ReactElementValidator.cloneElement;
1655
- }
1399
+ var REACT_FRAGMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.fragment') || 0xeacb;
1656
1400
 
1657
1401
  var React = {
1658
1402
  Children: {
1659
- map: ReactChildren_1.map,
1660
- forEach: ReactChildren_1.forEach,
1661
- count: ReactChildren_1.count,
1662
- toArray: ReactChildren_1.toArray,
1663
- only: onlyChild_1
1403
+ map: mapChildren,
1404
+ forEach: forEachChildren,
1405
+ count: countChildren,
1406
+ toArray: toArray,
1407
+ only: onlyChild
1664
1408
  },
1665
1409
 
1666
- Component: ReactBaseClasses.Component,
1667
- PureComponent: ReactBaseClasses.PureComponent,
1668
- unstable_AsyncComponent: ReactBaseClasses.AsyncComponent,
1410
+ Component: Component,
1411
+ PureComponent: PureComponent,
1412
+ unstable_AsyncComponent: AsyncComponent,
1669
1413
 
1670
- createElement: createElement,
1671
- cloneElement: cloneElement,
1672
- isValidElement: ReactElement_1.isValidElement,
1673
-
1674
- createFactory: createFactory,
1414
+ createElement: createElementWithValidation,
1415
+ cloneElement: cloneElementWithValidation,
1416
+ createFactory: createFactoryWithValidation,
1417
+ isValidElement: isValidElement,
1675
1418
 
1676
1419
  version: ReactVersion,
1677
1420
 
1678
1421
  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
1679
- ReactCurrentOwner: ReactCurrentOwner_1,
1422
+ ReactCurrentOwner: ReactCurrentOwner,
1680
1423
  // Used by renderers to avoid bundling object-assign twice in UMD bundles:
1681
- assign: objectAssign$1
1424
+ assign: _assign
1682
1425
  }
1683
1426
  };
1684
1427
 
1428
+ if (ReactFeatureFlags.enableReactFragment) {
1429
+ React.Fragment = REACT_FRAGMENT_TYPE;
1430
+ }
1431
+
1685
1432
  {
1686
- objectAssign$1(React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, {
1433
+ _assign(React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, {
1687
1434
  // These should not be included in production.
1688
- ReactComponentTreeHook: ReactComponentTreeHook_1,
1689
- ReactDebugCurrentFrame: ReactDebugCurrentFrame_1
1435
+ ReactDebugCurrentFrame: ReactDebugCurrentFrame,
1436
+ // Shim for React DOM 16.0.0 which still destructured (but not used) this.
1437
+ // TODO: remove in React 17.0.
1438
+ ReactComponentTreeHook: {}
1690
1439
  });
1691
1440
  }
1692
1441
 
1693
- var ReactEntry = React;
1694
1442
 
1695
- module.exports = ReactEntry;
1443
+
1444
+ var React$2 = Object.freeze({
1445
+ default: React
1446
+ });
1447
+
1448
+ var React$3 = ( React$2 && React ) || React$2;
1449
+
1450
+ /**
1451
+ * Copyright (c) 2013-present, Facebook, Inc.
1452
+ *
1453
+ * This source code is licensed under the MIT license found in the
1454
+ * LICENSE file in the root directory of this source tree.
1455
+ *
1456
+ *
1457
+ */
1458
+
1459
+
1460
+
1461
+
1462
+
1463
+ // TODO: decide on the top-level export form.
1464
+ // This is hacky but makes it work with both Rollup and Jest.
1465
+ var react = React$3['default'] ? React$3['default'] : React$3;
1466
+
1467
+ module.exports = react;
1696
1468
 
1697
1469
  })();
1698
1470
  }