react 16.0.0-rc.1 → 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/LICENSE CHANGED
@@ -1,31 +1,21 @@
1
- BSD License
2
-
3
- For React software
1
+ MIT License
4
2
 
5
3
  Copyright (c) 2013-present, Facebook, Inc.
6
- All rights reserved.
7
-
8
- Redistribution and use in source and binary forms, with or without modification,
9
- are permitted provided that the following conditions are met:
10
-
11
- * Redistributions of source code must retain the above copyright notice, this
12
- list of conditions and the following disclaimer.
13
4
 
14
- * Redistributions in binary form must reproduce the above copyright notice,
15
- this list of conditions and the following disclaimer in the documentation
16
- and/or other materials provided with the distribution.
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
17
11
 
18
- * Neither the name Facebook nor the names of its contributors may be used to
19
- endorse or promote products derived from this software without specific
20
- prior written permission.
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
21
14
 
22
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
23
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
26
- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
29
- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
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,3 +1,11 @@
1
+ /** @license React v16.1.0-beta
2
+ * react.development.js
3
+ *
4
+ * Copyright (c) 2013-present, Facebook, Inc.
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
1
9
  'use strict';
2
10
 
3
11
 
@@ -6,33 +14,149 @@ if (process.env.NODE_ENV !== "production") {
6
14
 
7
15
  'use strict';
8
16
 
9
- var objectAssign$1 = require('object-assign');
10
- var require$$0 = require('fbjs/lib/warning');
17
+ var _assign = require('object-assign');
11
18
  var emptyObject = require('fbjs/lib/emptyObject');
12
19
  var invariant = require('fbjs/lib/invariant');
20
+ var warning = require('fbjs/lib/warning');
13
21
  var emptyFunction = require('fbjs/lib/emptyFunction');
14
22
  var checkPropTypes = require('prop-types/checkPropTypes');
15
23
 
16
24
  /**
17
25
  * Copyright (c) 2013-present, Facebook, Inc.
18
- * All rights reserved.
19
26
  *
20
- * This source code is licensed under the BSD-style license found in the
21
- * LICENSE file in the root directory of this source tree. An additional grant
22
- * of patent rights can be found in the PATENTS file in the same directory.
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
+
65
+ /**
66
+ * Copyright (c) 2013-present, Facebook, Inc.
67
+ *
68
+ * This source code is licensed under the MIT license found in the
69
+ * LICENSE file in the root directory of this source tree.
23
70
  *
24
- * @providesModule reactProdInvariant
25
71
  *
26
72
  */
27
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
+
28
104
  {
29
- 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
+ };
30
137
  }
31
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
+
32
150
  function warnNoop(publicInstance, callerName) {
33
151
  {
34
152
  var constructor = publicInstance.constructor;
35
- 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;
36
160
  }
37
161
  }
38
162
 
@@ -104,85 +228,26 @@ var ReactNoopUpdateQueue = {
104
228
  }
105
229
  };
106
230
 
107
- var ReactNoopUpdateQueue_1 = ReactNoopUpdateQueue;
108
-
109
231
  /**
110
- * Copyright 2014-2015, Facebook, Inc.
111
- * All rights reserved.
112
- *
113
- * This source code is licensed under the BSD-style license found in the
114
- * LICENSE file in the root directory of this source tree. An additional grant
115
- * of patent rights can be found in the PATENTS file in the same directory.
232
+ * Copyright (c) 2013-present, Facebook, Inc.
116
233
  *
117
- * @providesModule lowPriorityWarning
234
+ * This source code is licensed under the MIT license found in the
235
+ * LICENSE file in the root directory of this source tree.
118
236
  */
119
237
 
120
- /**
121
- * Forked from fbjs/warning:
122
- * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
123
- *
124
- * Only change is we use console.warn instead of console.error,
125
- * and do nothing when 'console' is not supported.
126
- * This really simplifies the code.
127
- * ---
128
- * Similar to invariant but only logs a warning if the condition is not met.
129
- * This can be used to log issues in development environments in critical
130
- * paths. Removing the logging code for production environments will keep the
131
- * same logic and follow the same code paths.
132
- */
133
-
134
- var lowPriorityWarning = function () {};
135
-
136
- {
137
- var printWarning = function (format) {
138
- for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
139
- args[_key - 1] = arguments[_key];
140
- }
141
-
142
- var argIndex = 0;
143
- var message = 'Warning: ' + format.replace(/%s/g, function () {
144
- return args[argIndex++];
145
- });
146
- if (typeof console !== 'undefined') {
147
- console.warn(message);
148
- }
149
- try {
150
- // --- Welcome to debugging React ---
151
- // This error was thrown as a convenience so that you can use this stack
152
- // to find the callsite that caused this warning to fire.
153
- throw new Error(message);
154
- } catch (x) {}
155
- };
156
-
157
- lowPriorityWarning = function (condition, format) {
158
- if (format === undefined) {
159
- throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
160
- }
161
- if (!condition) {
162
- for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
163
- args[_key2 - 2] = arguments[_key2];
164
- }
165
-
166
- printWarning.apply(undefined, [format].concat(args));
167
- }
168
- };
169
- }
170
-
171
- var lowPriorityWarning_1 = lowPriorityWarning;
172
-
173
238
  /**
174
239
  * Base class helpers for the updating state of a component.
175
240
  */
176
- function ReactComponent(props, context, updater) {
241
+ function Component(props, context, updater) {
177
242
  this.props = props;
178
243
  this.context = context;
179
244
  this.refs = emptyObject;
180
245
  // We initialize the default updater but the real one gets injected by the
181
246
  // renderer.
182
- this.updater = updater || ReactNoopUpdateQueue_1;
247
+ this.updater = updater || ReactNoopUpdateQueue;
183
248
  }
184
249
 
185
- ReactComponent.prototype.isReactComponent = {};
250
+ Component.prototype.isReactComponent = {};
186
251
 
187
252
  /**
188
253
  * Sets a subset of the state. Always use this to mutate
@@ -209,7 +274,7 @@ ReactComponent.prototype.isReactComponent = {};
209
274
  * @final
210
275
  * @protected
211
276
  */
212
- ReactComponent.prototype.setState = function (partialState, callback) {
277
+ Component.prototype.setState = function (partialState, callback) {
213
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;
214
279
  this.updater.enqueueSetState(this, partialState, callback, 'setState');
215
280
  };
@@ -228,7 +293,7 @@ ReactComponent.prototype.setState = function (partialState, callback) {
228
293
  * @final
229
294
  * @protected
230
295
  */
231
- ReactComponent.prototype.forceUpdate = function (callback) {
296
+ Component.prototype.forceUpdate = function (callback) {
232
297
  this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
233
298
  };
234
299
 
@@ -243,9 +308,9 @@ ReactComponent.prototype.forceUpdate = function (callback) {
243
308
  replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
244
309
  };
245
310
  var defineDeprecationWarning = function (methodName, info) {
246
- Object.defineProperty(ReactComponent.prototype, methodName, {
311
+ Object.defineProperty(Component.prototype, methodName, {
247
312
  get: function () {
248
- 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]);
249
314
  return undefined;
250
315
  }
251
316
  });
@@ -260,61 +325,43 @@ ReactComponent.prototype.forceUpdate = function (callback) {
260
325
  /**
261
326
  * Base class helpers for the updating state of a component.
262
327
  */
263
- function ReactPureComponent(props, context, updater) {
264
- // Duplicated from ReactComponent.
328
+ function PureComponent(props, context, updater) {
329
+ // Duplicated from Component.
265
330
  this.props = props;
266
331
  this.context = context;
267
332
  this.refs = emptyObject;
268
333
  // We initialize the default updater but the real one gets injected by the
269
334
  // renderer.
270
- this.updater = updater || ReactNoopUpdateQueue_1;
335
+ this.updater = updater || ReactNoopUpdateQueue;
271
336
  }
272
337
 
273
338
  function ComponentDummy() {}
274
- ComponentDummy.prototype = ReactComponent.prototype;
275
- var pureComponentPrototype = ReactPureComponent.prototype = new ComponentDummy();
276
- pureComponentPrototype.constructor = ReactPureComponent;
339
+ ComponentDummy.prototype = Component.prototype;
340
+ var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
341
+ pureComponentPrototype.constructor = PureComponent;
277
342
  // Avoid an extra prototype jump for these methods.
278
- objectAssign$1(pureComponentPrototype, ReactComponent.prototype);
343
+ _assign(pureComponentPrototype, Component.prototype);
279
344
  pureComponentPrototype.isPureReactComponent = true;
280
345
 
281
- function ReactAsyncComponent(props, context, updater) {
282
- // Duplicated from ReactComponent.
346
+ function AsyncComponent(props, context, updater) {
347
+ // Duplicated from Component.
283
348
  this.props = props;
284
349
  this.context = context;
285
350
  this.refs = emptyObject;
286
351
  // We initialize the default updater but the real one gets injected by the
287
352
  // renderer.
288
- this.updater = updater || ReactNoopUpdateQueue_1;
353
+ this.updater = updater || ReactNoopUpdateQueue;
289
354
  }
290
355
 
291
- var asyncComponentPrototype = ReactAsyncComponent.prototype = new ComponentDummy();
292
- asyncComponentPrototype.constructor = ReactAsyncComponent;
356
+ var asyncComponentPrototype = AsyncComponent.prototype = new ComponentDummy();
357
+ asyncComponentPrototype.constructor = AsyncComponent;
293
358
  // Avoid an extra prototype jump for these methods.
294
- objectAssign$1(asyncComponentPrototype, ReactComponent.prototype);
359
+ _assign(asyncComponentPrototype, Component.prototype);
295
360
  asyncComponentPrototype.unstable_isAsyncReactComponent = true;
296
361
  asyncComponentPrototype.render = function () {
297
362
  return this.props.children;
298
363
  };
299
364
 
300
- var ReactBaseClasses = {
301
- Component: ReactComponent,
302
- PureComponent: ReactPureComponent,
303
- AsyncComponent: ReactAsyncComponent
304
- };
305
-
306
- /**
307
- * Copyright 2013-present, Facebook, Inc.
308
- * All rights reserved.
309
- *
310
- * This source code is licensed under the BSD-style license found in the
311
- * LICENSE file in the root directory of this source tree. An additional grant
312
- * of patent rights can be found in the PATENTS file in the same directory.
313
- *
314
- * @providesModule ReactCurrentOwner
315
- *
316
- */
317
-
318
365
  /**
319
366
  * Keeps track of the current owner.
320
367
  *
@@ -327,16 +374,24 @@ var ReactCurrentOwner = {
327
374
  * @type {ReactComponent}
328
375
  */
329
376
  current: null
330
- };
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
+ */
331
385
 
332
- 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
+ */
333
392
 
334
393
  var hasOwnProperty = Object.prototype.hasOwnProperty;
335
394
 
336
- {
337
- var warning$2 = require$$0;
338
- }
339
-
340
395
  // The Symbol used to tag the ReactElement type. If there is no native Symbol
341
396
  // nor polyfill, then a plain number is used for performance.
342
397
  var REACT_ELEMENT_TYPE$1 = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
@@ -379,7 +434,7 @@ function defineKeyPropWarningGetter(props, displayName) {
379
434
  var warnAboutAccessingKey = function () {
380
435
  if (!specialPropKeyWarningShown) {
381
436
  specialPropKeyWarningShown = true;
382
- 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);
383
438
  }
384
439
  };
385
440
  warnAboutAccessingKey.isReactWarning = true;
@@ -393,7 +448,7 @@ function defineRefPropWarningGetter(props, displayName) {
393
448
  var warnAboutAccessingRef = function () {
394
449
  if (!specialPropRefWarningShown) {
395
450
  specialPropRefWarningShown = true;
396
- 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);
397
452
  }
398
453
  };
399
454
  warnAboutAccessingRef.isReactWarning = true;
@@ -481,9 +536,9 @@ var ReactElement = function (type, key, ref, self, source, owner, props) {
481
536
 
482
537
  /**
483
538
  * Create and return a new ReactElement of the given type.
484
- * See https://facebook.github.io/react/docs/react-api.html#createelement
539
+ * See https://reactjs.org/docs/react-api.html#createelement
485
540
  */
486
- ReactElement.createElement = function (type, config, children) {
541
+ function createElement(type, config, children) {
487
542
  var propName;
488
543
 
489
544
  // Reserved names are extracted
@@ -552,39 +607,30 @@ ReactElement.createElement = function (type, config, children) {
552
607
  }
553
608
  }
554
609
  }
555
- return ReactElement(type, key, ref, self, source, ReactCurrentOwner_1.current, props);
556
- };
610
+ return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
611
+ }
557
612
 
558
613
  /**
559
614
  * Return a function that produces ReactElements of a given type.
560
- * See https://facebook.github.io/react/docs/react-api.html#createfactory
615
+ * See https://reactjs.org/docs/react-api.html#createfactory
561
616
  */
562
- ReactElement.createFactory = function (type) {
563
- var factory = ReactElement.createElement.bind(null, type);
564
- // Expose the type on the factory and the prototype so that it can be
565
- // easily accessed on elements. E.g. `<Foo />.type === Foo`.
566
- // This should not be named `constructor` since this may not be the function
567
- // that created the element, and it may not even be a constructor.
568
- // Legacy hook TODO: Warn if this is accessed
569
- factory.type = type;
570
- return factory;
571
- };
572
617
 
573
- ReactElement.cloneAndReplaceKey = function (oldElement, newKey) {
618
+
619
+ function cloneAndReplaceKey(oldElement, newKey) {
574
620
  var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
575
621
 
576
622
  return newElement;
577
- };
623
+ }
578
624
 
579
625
  /**
580
626
  * Clone and return a new ReactElement using element as the starting point.
581
- * See https://facebook.github.io/react/docs/react-api.html#cloneelement
627
+ * See https://reactjs.org/docs/react-api.html#cloneelement
582
628
  */
583
- ReactElement.cloneElement = function (element, config, children) {
629
+ function cloneElement(element, config, children) {
584
630
  var propName;
585
631
 
586
632
  // Original props are copied
587
- var props = objectAssign$1({}, element.props);
633
+ var props = _assign({}, element.props);
588
634
 
589
635
  // Reserved names are extracted
590
636
  var key = element.key;
@@ -603,7 +649,7 @@ ReactElement.cloneElement = function (element, config, children) {
603
649
  if (hasValidRef(config)) {
604
650
  // Silently steal the ref from the parent.
605
651
  ref = config.ref;
606
- owner = ReactCurrentOwner_1.current;
652
+ owner = ReactCurrentOwner.current;
607
653
  }
608
654
  if (hasValidKey(config)) {
609
655
  key = '' + config.key;
@@ -640,30 +686,25 @@ ReactElement.cloneElement = function (element, config, children) {
640
686
  }
641
687
 
642
688
  return ReactElement(element.type, key, ref, self, source, owner, props);
643
- };
689
+ }
644
690
 
645
691
  /**
646
692
  * Verifies the object is a ReactElement.
647
- * See https://facebook.github.io/react/docs/react-api.html#isvalidelement
693
+ * See https://reactjs.org/docs/react-api.html#isvalidelement
648
694
  * @param {?object} object
649
695
  * @return {boolean} True if `object` is a valid component.
650
696
  * @final
651
697
  */
652
- ReactElement.isValidElement = function (object) {
698
+ function isValidElement(object) {
653
699
  return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE$1;
654
- };
655
-
656
- var ReactElement_1 = ReactElement;
700
+ }
657
701
 
658
702
  /**
659
- * Copyright 2013-present, Facebook, Inc.
660
- * All rights reserved.
703
+ * Copyright (c) 2013-present, Facebook, Inc.
661
704
  *
662
- * This source code is licensed under the BSD-style license found in the
663
- * LICENSE file in the root directory of this source tree. An additional grant
664
- * of patent rights can be found in the PATENTS file in the same directory.
705
+ * This source code is licensed under the MIT license found in the
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,33 +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 2013-present, Facebook, Inc.
996
- * All rights reserved.
997
- *
998
- * This source code is licensed under the BSD-style license found in the
999
- * LICENSE file in the root directory of this source tree. An additional grant
1000
- * of patent rights can be found in the PATENTS file in the same directory.
1001
- *
1002
- * @providesModule ReactVersion
1003
- */
1004
-
1005
- var ReactVersion = '16.0.0-rc.1';
1006
-
1007
1024
  /**
1008
1025
  * Returns the first child in a collection of children and verifies that there
1009
1026
  * is only one child in the collection.
1010
1027
  *
1011
- * 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
1012
1029
  *
1013
1030
  * The current implementation of this function assumes that a single child gets
1014
1031
  * passed without a wrapper, but the purpose of this helper function is to
@@ -1019,71 +1036,57 @@ var ReactVersion = '16.0.0-rc.1';
1019
1036
  * structure.
1020
1037
  */
1021
1038
  function onlyChild(children) {
1022
- !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;
1023
1040
  return children;
1024
1041
  }
1025
1042
 
1026
- var onlyChild_1 = onlyChild;
1027
-
1028
1043
  /**
1029
- * Copyright 2016-present, Facebook, Inc.
1030
- * All rights reserved.
1044
+ * Copyright (c) 2016-present, Facebook, Inc.
1031
1045
  *
1032
- * This source code is licensed under the BSD-style license found in the
1033
- * LICENSE file in the root directory of this source tree. An additional grant
1034
- * of patent rights can be found in the PATENTS file in the same directory.
1046
+ * This source code is licensed under the MIT license found in the
1047
+ * LICENSE file in the root directory of this source tree.
1035
1048
  *
1036
1049
  *
1037
- * @providesModule describeComponentFrame
1038
1050
  */
1039
1051
 
1040
- var describeComponentFrame$1 = function (name, source, ownerName) {
1052
+ var describeComponentFrame = function (name, source, ownerName) {
1041
1053
  return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
1042
1054
  };
1043
1055
 
1044
- /**
1045
- * Copyright 2013-present, Facebook, Inc.
1046
- * All rights reserved.
1047
- *
1048
- * This source code is licensed under the BSD-style license found in the
1049
- * LICENSE file in the root directory of this source tree. An additional grant
1050
- * of patent rights can be found in the PATENTS file in the same directory.
1051
- *
1052
- * @providesModule getComponentName
1053
- *
1054
- */
1056
+ function getComponentName(fiber) {
1057
+ var type = fiber.type;
1055
1058
 
1056
- function getComponentName$1(instanceOrFiber) {
1057
- if (typeof instanceOrFiber.getName === 'function') {
1058
- // Stack reconciler
1059
- var instance = instanceOrFiber;
1060
- return instance.getName();
1059
+ if (typeof type === 'string') {
1060
+ return type;
1061
1061
  }
1062
- if (typeof instanceOrFiber.tag === 'number') {
1063
- // Fiber reconciler
1064
- var fiber = instanceOrFiber;
1065
- var type = fiber.type;
1066
-
1067
- if (typeof type === 'string') {
1068
- return type;
1069
- }
1070
- if (typeof type === 'function') {
1071
- return type.displayName || type.name;
1072
- }
1062
+ if (typeof type === 'function') {
1063
+ return type.displayName || type.name;
1073
1064
  }
1074
1065
  return null;
1075
- }
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
+ */
1076
1074
 
1077
- var getComponentName_1 = getComponentName$1;
1075
+ /**
1076
+ * Copyright (c) 2014-present, Facebook, Inc.
1077
+ *
1078
+ * This source code is licensed under the MIT license found in the
1079
+ * LICENSE file in the root directory of this source tree.
1080
+ */
1078
1081
 
1079
- {
1080
- var checkPropTypes$1 = checkPropTypes;
1081
- var lowPriorityWarning$1 = lowPriorityWarning_1;
1082
- var ReactDebugCurrentFrame$1 = ReactDebugCurrentFrame_1;
1083
- var warning$3 = require$$0;
1084
- var describeComponentFrame = describeComponentFrame$1;
1085
- var getComponentName = 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
+ */
1086
1088
 
1089
+ {
1087
1090
  var currentlyValidatingElement = null;
1088
1091
 
1089
1092
  var getDisplayName = function (element) {
@@ -1093,29 +1096,35 @@ var getComponentName_1 = getComponentName$1;
1093
1096
  return '#text';
1094
1097
  } else if (typeof element.type === 'string') {
1095
1098
  return element.type;
1099
+ } else if (element.type === REACT_FRAGMENT_TYPE$1) {
1100
+ return 'React.Fragment';
1096
1101
  } else {
1097
1102
  return element.type.displayName || element.type.name || 'Unknown';
1098
1103
  }
1099
1104
  };
1100
1105
 
1101
- var getStackAddendum$1 = function () {
1106
+ var getStackAddendum = function () {
1102
1107
  var stack = '';
1103
1108
  if (currentlyValidatingElement) {
1104
1109
  var name = getDisplayName(currentlyValidatingElement);
1105
1110
  var owner = currentlyValidatingElement._owner;
1106
1111
  stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner));
1107
1112
  }
1108
- stack += ReactDebugCurrentFrame$1.getStackAddendum() || '';
1113
+ stack += ReactDebugCurrentFrame.getStackAddendum() || '';
1109
1114
  return stack;
1110
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]]);
1111
1120
  }
1112
1121
 
1113
1122
  var ITERATOR_SYMBOL$1 = typeof Symbol === 'function' && Symbol.iterator;
1114
1123
  var FAUX_ITERATOR_SYMBOL$1 = '@@iterator'; // Before Symbol spec.
1115
1124
 
1116
1125
  function getDeclarationErrorAddendum() {
1117
- if (ReactCurrentOwner_1.current) {
1118
- var name = getComponentName(ReactCurrentOwner_1.current);
1126
+ if (ReactCurrentOwner.current) {
1127
+ var name = getComponentName(ReactCurrentOwner.current);
1119
1128
  if (name) {
1120
1129
  return '\n\nCheck the render method of `' + name + '`.';
1121
1130
  }
@@ -1179,14 +1188,14 @@ function validateExplicitKey(element, parentType) {
1179
1188
  // property, it may be the creator of the child that's responsible for
1180
1189
  // assigning it a key.
1181
1190
  var childOwner = '';
1182
- if (element && element._owner && element._owner !== ReactCurrentOwner_1.current) {
1191
+ if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
1183
1192
  // Give the component that originally created this child.
1184
1193
  childOwner = ' It was passed a child from ' + getComponentName(element._owner) + '.';
1185
1194
  }
1186
1195
 
1187
1196
  currentlyValidatingElement = element;
1188
1197
  {
1189
- 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());
1190
1199
  }
1191
1200
  currentlyValidatingElement = null;
1192
1201
  }
@@ -1207,11 +1216,11 @@ function validateChildKeys(node, parentType) {
1207
1216
  if (Array.isArray(node)) {
1208
1217
  for (var i = 0; i < node.length; i++) {
1209
1218
  var child = node[i];
1210
- if (ReactElement_1.isValidElement(child)) {
1219
+ if (isValidElement(child)) {
1211
1220
  validateExplicitKey(child, parentType);
1212
1221
  }
1213
1222
  }
1214
- } else if (ReactElement_1.isValidElement(node)) {
1223
+ } else if (isValidElement(node)) {
1215
1224
  // This element was passed in a valid location.
1216
1225
  if (node._store) {
1217
1226
  node._store.validated = true;
@@ -1225,7 +1234,7 @@ function validateChildKeys(node, parentType) {
1225
1234
  var iterator = iteratorFn.call(node);
1226
1235
  var step;
1227
1236
  while (!(step = iterator.next()).done) {
1228
- if (ReactElement_1.isValidElement(step.value)) {
1237
+ if (isValidElement(step.value)) {
1229
1238
  validateExplicitKey(step.value, parentType);
1230
1239
  }
1231
1240
  }
@@ -1246,463 +1255,216 @@ function validatePropTypes(element) {
1246
1255
  return;
1247
1256
  }
1248
1257
  var name = componentClass.displayName || componentClass.name;
1249
-
1250
- // ReactNative `View.propTypes` have been deprecated in favor of `ViewPropTypes`.
1251
- // In their place a temporary getter has been added with a deprecated warning message.
1252
- // Avoid triggering that warning during validation using the temporary workaround,
1253
- // __propTypesSecretDontUseThesePlease.
1254
- // TODO (bvaughn) Revert this particular change any time after April 1 ReactNative tag.
1255
- var propTypes = typeof componentClass.__propTypesSecretDontUseThesePlease === 'object' ? componentClass.__propTypesSecretDontUseThesePlease : componentClass.propTypes;
1258
+ var propTypes = componentClass.propTypes;
1256
1259
 
1257
1260
  if (propTypes) {
1258
1261
  currentlyValidatingElement = element;
1259
- checkPropTypes$1(propTypes, element.props, 'prop', name, getStackAddendum$1);
1262
+ checkPropTypes(propTypes, element.props, 'prop', name, getStackAddendum);
1260
1263
  currentlyValidatingElement = null;
1261
1264
  }
1262
1265
  if (typeof componentClass.getDefaultProps === 'function') {
1263
- 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.');
1264
1267
  }
1265
1268
  }
1266
1269
 
1267
- var ReactElementValidator$1 = {
1268
- createElement: function (type, props, children) {
1269
- var validType = typeof type === 'string' || typeof type === 'function';
1270
- // We warn in this case but don't throw. We expect the element creation to
1271
- // succeed and there will likely be errors in render.
1272
- if (!validType) {
1273
- var info = '';
1274
- if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
1275
- info += ' You likely forgot to export your component from the file ' + "it's defined in.";
1276
- }
1277
-
1278
- var sourceInfo = getSourceInfoErrorAddendum(props);
1279
- if (sourceInfo) {
1280
- info += sourceInfo;
1281
- } else {
1282
- info += getDeclarationErrorAddendum();
1283
- }
1284
-
1285
- 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;
1286
1276
 
1287
- 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);
1288
- }
1277
+ var _iteratorNormalCompletion = true;
1278
+ var _didIteratorError = false;
1279
+ var _iteratorError = undefined;
1289
1280
 
1290
- 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;
1291
1284
 
1292
- // The result can be nullish if a mock or a custom function is used.
1293
- // TODO: Drop this when these are no longer allowed as the type argument.
1294
- if (element == null) {
1295
- 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
+ }
1296
1289
  }
1297
-
1298
- // Skip key warning if the type isn't valid since our key validation logic
1299
- // doesn't expect a non-string/function type and can throw confusing errors.
1300
- // We don't want exception behavior to differ between dev and prod.
1301
- // (Rendering will throw with a helpful message and as soon as the type is
1302
- // fixed, the key warnings will appear.)
1303
- if (validType) {
1304
- for (var i = 2; i < arguments.length; i++) {
1305
- 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;
1306
1301
  }
1307
1302
  }
1303
+ }
1308
1304
 
1309
- validatePropTypes(element);
1310
-
1311
- return element;
1312
- },
1305
+ if (fragment.ref !== null) {
1306
+ warning(false, 'Invalid attribute `ref` supplied to `React.Fragment`.%s', getStackAddendum());
1307
+ }
1313
1308
 
1314
- createFactory: function (type) {
1315
- var validatedFactory = ReactElementValidator$1.createElement.bind(null, type);
1316
- // Legacy hook TODO: Warn if this is accessed
1317
- validatedFactory.type = type;
1309
+ currentlyValidatingElement = null;
1310
+ }
1318
1311
 
1319
- {
1320
- Object.defineProperty(validatedFactory, 'type', {
1321
- enumerable: false,
1322
- get: function () {
1323
- lowPriorityWarning$1(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
1324
- Object.defineProperty(this, 'type', {
1325
- value: type
1326
- });
1327
- return type;
1328
- }
1329
- });
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.";
1330
1320
  }
1331
1321
 
1332
- return validatedFactory;
1333
- },
1334
-
1335
- cloneElement: function (element, props, children) {
1336
- var newElement = ReactElement_1.cloneElement.apply(this, arguments);
1337
- for (var i = 2; i < arguments.length; i++) {
1338
- validateChildKeys(arguments[i], newElement.type);
1322
+ var sourceInfo = getSourceInfoErrorAddendum(props);
1323
+ if (sourceInfo) {
1324
+ info += sourceInfo;
1325
+ } else {
1326
+ info += getDeclarationErrorAddendum();
1339
1327
  }
1340
- validatePropTypes(newElement);
1341
- return newElement;
1342
- }
1343
- };
1344
1328
 
1345
- var ReactElementValidator_1 = ReactElementValidator$1;
1329
+ info += getStackAddendum() || '';
1346
1330
 
1347
- {
1348
- var warning$4 = require$$0;
1349
- }
1350
-
1351
- function isNative(fn) {
1352
- // Based on isNative() from Lodash
1353
- var funcToString = Function.prototype.toString;
1354
- var reIsNative = RegExp('^' + funcToString
1355
- // Take an example native function source for comparison
1356
- .call(Object.prototype.hasOwnProperty)
1357
- // Strip regex characters so we can use it for regex
1358
- .replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
1359
- // Remove hasOwnProperty from the template to make it generic
1360
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
1361
- try {
1362
- var source = funcToString.call(fn);
1363
- return reIsNative.test(source);
1364
- } catch (err) {
1365
- 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);
1366
1332
  }
1367
- }
1368
-
1369
- var canUseCollections =
1370
- // Array.from
1371
- typeof Array.from === 'function' &&
1372
- // Map
1373
- typeof Map === 'function' && isNative(Map) &&
1374
- // Map.prototype.keys
1375
- Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) &&
1376
- // Set
1377
- typeof Set === 'function' && isNative(Set) &&
1378
- // Set.prototype.keys
1379
- Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys);
1380
-
1381
- var setItem;
1382
- var getItem;
1383
- var removeItem;
1384
- var getItemIDs;
1385
- var addRoot;
1386
- var removeRoot;
1387
- var getRootIDs;
1388
-
1389
- if (canUseCollections) {
1390
- var itemMap = new Map();
1391
- var rootIDSet = new Set();
1392
-
1393
- setItem = function (id, item) {
1394
- itemMap.set(id, item);
1395
- };
1396
- getItem = function (id) {
1397
- return itemMap.get(id);
1398
- };
1399
- removeItem = function (id) {
1400
- itemMap['delete'](id);
1401
- };
1402
- getItemIDs = function () {
1403
- return Array.from(itemMap.keys());
1404
- };
1405
-
1406
- addRoot = function (id) {
1407
- rootIDSet.add(id);
1408
- };
1409
- removeRoot = function (id) {
1410
- rootIDSet['delete'](id);
1411
- };
1412
- getRootIDs = function () {
1413
- return Array.from(rootIDSet.keys());
1414
- };
1415
- } else {
1416
- var itemByKey = {};
1417
- var rootByKey = {};
1418
-
1419
- // Use non-numeric keys to prevent V8 performance issues:
1420
- // https://github.com/facebook/react/pull/7232
1421
- var getKeyFromID = function (id) {
1422
- return '.' + id;
1423
- };
1424
- var getIDFromKey = function (key) {
1425
- return parseInt(key.substr(1), 10);
1426
- };
1427
-
1428
- setItem = function (id, item) {
1429
- var key = getKeyFromID(id);
1430
- itemByKey[key] = item;
1431
- };
1432
- getItem = function (id) {
1433
- var key = getKeyFromID(id);
1434
- return itemByKey[key];
1435
- };
1436
- removeItem = function (id) {
1437
- var key = getKeyFromID(id);
1438
- delete itemByKey[key];
1439
- };
1440
- getItemIDs = function () {
1441
- return Object.keys(itemByKey).map(getIDFromKey);
1442
- };
1443
-
1444
- addRoot = function (id) {
1445
- var key = getKeyFromID(id);
1446
- rootByKey[key] = true;
1447
- };
1448
- removeRoot = function (id) {
1449
- var key = getKeyFromID(id);
1450
- delete rootByKey[key];
1451
- };
1452
- getRootIDs = function () {
1453
- return Object.keys(rootByKey).map(getIDFromKey);
1454
- };
1455
- }
1456
1333
 
1457
- var unmountedIDs = [];
1334
+ var element = createElement.apply(this, arguments);
1458
1335
 
1459
- function purgeDeep(id) {
1460
- var item = getItem(id);
1461
- if (item) {
1462
- 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
+ }
1463
1341
 
1464
- removeItem(id);
1465
- 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
+ }
1466
1351
  }
1467
- }
1468
1352
 
1469
- function getDisplayName$1(element) {
1470
- if (element == null) {
1471
- return '#empty';
1472
- } else if (typeof element === 'string' || typeof element === 'number') {
1473
- return '#text';
1474
- } else if (typeof element.type === 'string') {
1475
- return element.type;
1353
+ if (typeof type === 'symbol' && type === REACT_FRAGMENT_TYPE$1) {
1354
+ validateFragmentProps(element);
1476
1355
  } else {
1477
- return element.type.displayName || element.type.name || 'Unknown';
1356
+ validatePropTypes(element);
1478
1357
  }
1479
- }
1480
1358
 
1481
- function describeID(id) {
1482
- var name = ReactComponentTreeHook.getDisplayName(id);
1483
- var element = ReactComponentTreeHook.getElement(id);
1484
- var ownerID = ReactComponentTreeHook.getOwnerID(id);
1485
- var ownerName = void 0;
1486
-
1487
- if (ownerID) {
1488
- ownerName = ReactComponentTreeHook.getDisplayName(ownerID);
1489
- }
1490
- warning$4(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id);
1491
- return describeComponentFrame$1(name || '', element && element._source, ownerName || '');
1359
+ return element;
1492
1360
  }
1493
1361
 
1494
- var ReactComponentTreeHook = {
1495
- onSetChildren: function (id, nextChildIDs) {
1496
- var item = getItem(id);
1497
- !item ? invariant(false, 'Item must have been set') : void 0;
1498
- item.childIDs = nextChildIDs;
1499
-
1500
- for (var i = 0; i < nextChildIDs.length; i++) {
1501
- var nextChildID = nextChildIDs[i];
1502
- var nextChild = getItem(nextChildID);
1503
- !nextChild ? invariant(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : void 0;
1504
- !(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;
1505
- !nextChild.isMounted ? invariant(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : void 0;
1506
- if (nextChild.parentID == null) {
1507
- nextChild.parentID = id;
1508
- // TODO: This shouldn't be necessary but mounting a new root during in
1509
- // componentWillMount currently causes not-yet-mounted components to
1510
- // be purged from our tree data so their parent id is missing.
1511
- }
1512
- !(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;
1513
- }
1514
- },
1515
- onBeforeMountComponent: function (id, element, parentID) {
1516
- var item = {
1517
- element: element,
1518
- parentID: parentID,
1519
- text: null,
1520
- childIDs: [],
1521
- isMounted: false,
1522
- updateCount: 0
1523
- };
1524
- setItem(id, item);
1525
- },
1526
- onBeforeUpdateComponent: function (id, element) {
1527
- var item = getItem(id);
1528
- if (!item || !item.isMounted) {
1529
- // We may end up here as a result of setState() in componentWillUnmount().
1530
- // In this case, ignore the element.
1531
- return;
1532
- }
1533
- item.element = element;
1534
- },
1535
- onMountComponent: function (id) {
1536
- var item = getItem(id);
1537
- !item ? invariant(false, 'Item must have been set') : void 0;
1538
- item.isMounted = true;
1539
- var isRoot = item.parentID === 0;
1540
- if (isRoot) {
1541
- addRoot(id);
1542
- }
1543
- },
1544
- onUpdateComponent: function (id) {
1545
- var item = getItem(id);
1546
- if (!item || !item.isMounted) {
1547
- // We may end up here as a result of setState() in componentWillUnmount().
1548
- // In this case, ignore the element.
1549
- return;
1550
- }
1551
- item.updateCount++;
1552
- },
1553
- onUnmountComponent: function (id) {
1554
- var item = getItem(id);
1555
- if (item) {
1556
- // We need to check if it exists.
1557
- // `item` might not exist if it is inside an error boundary, and a sibling
1558
- // error boundary child threw while mounting. Then this instance never
1559
- // got a chance to mount, but it still gets an unmounting event during
1560
- // the error boundary cleanup.
1561
- item.isMounted = false;
1562
- var isRoot = item.parentID === 0;
1563
- if (isRoot) {
1564
- removeRoot(id);
1565
- }
1566
- }
1567
- unmountedIDs.push(id);
1568
- },
1569
- purgeUnmountedComponents: function () {
1570
- if (ReactComponentTreeHook._preventPurging) {
1571
- // Should only be used for testing.
1572
- return;
1573
- }
1362
+ function createFactoryWithValidation(type) {
1363
+ var validatedFactory = createElementWithValidation.bind(null, type);
1364
+ // Legacy hook TODO: Warn if this is accessed
1365
+ validatedFactory.type = type;
1574
1366
 
1575
- for (var i = 0; i < unmountedIDs.length; i++) {
1576
- var id = unmountedIDs[i];
1577
- purgeDeep(id);
1578
- }
1579
- unmountedIDs.length = 0;
1580
- },
1581
- isMounted: function (id) {
1582
- var item = getItem(id);
1583
- return item ? item.isMounted : false;
1584
- },
1585
- getCurrentStackAddendum: function () {
1586
- var info = '';
1587
- var currentOwner = ReactCurrentOwner_1.current;
1588
- if (currentOwner) {
1589
- !(typeof currentOwner.tag !== 'number') ? invariant(false, 'Fiber owners should not show up in Stack stack traces.') : void 0;
1590
- if (typeof currentOwner._debugID === 'number') {
1591
- 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;
1592
1376
  }
1593
- }
1594
- return info;
1595
- },
1596
- getStackAddendumByID: function (id) {
1597
- var info = '';
1598
- while (id) {
1599
- info += describeID(id);
1600
- id = ReactComponentTreeHook.getParentID(id);
1601
- }
1602
- return info;
1603
- },
1604
- getChildIDs: function (id) {
1605
- var item = getItem(id);
1606
- return item ? item.childIDs : [];
1607
- },
1608
- getDisplayName: function (id) {
1609
- var element = ReactComponentTreeHook.getElement(id);
1610
- if (!element) {
1611
- return null;
1612
- }
1613
- return getDisplayName$1(element);
1614
- },
1615
- getElement: function (id) {
1616
- var item = getItem(id);
1617
- return item ? item.element : null;
1618
- },
1619
- getOwnerID: function (id) {
1620
- var element = ReactComponentTreeHook.getElement(id);
1621
- if (!element || !element._owner) {
1622
- return null;
1623
- }
1624
- return element._owner._debugID;
1625
- },
1626
- getParentID: function (id) {
1627
- var item = getItem(id);
1628
- return item ? item.parentID : null;
1629
- },
1630
- getSource: function (id) {
1631
- var item = getItem(id);
1632
- var element = item ? item.element : null;
1633
- var source = element != null ? element._source : null;
1634
- return source;
1635
- },
1636
- getText: function (id) {
1637
- var element = ReactComponentTreeHook.getElement(id);
1638
- if (typeof element === 'string') {
1639
- return element;
1640
- } else if (typeof element === 'number') {
1641
- return '' + element;
1642
- } else {
1643
- return null;
1644
- }
1645
- },
1646
- getUpdateCount: function (id) {
1647
- var item = getItem(id);
1648
- return item ? item.updateCount : 0;
1649
- },
1650
-
1377
+ });
1378
+ }
1651
1379
 
1652
- getRootIDs: getRootIDs,
1653
- getRegisteredIDs: getItemIDs
1654
- };
1380
+ return validatedFactory;
1381
+ }
1655
1382
 
1656
- 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
+ }
1657
1391
 
1658
- var createElement = ReactElement_1.createElement;
1659
- var createFactory = ReactElement_1.createFactory;
1660
- 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
+ */
1661
1398
 
1662
- {
1663
- var ReactElementValidator = ReactElementValidator_1;
1664
- createElement = ReactElementValidator.createElement;
1665
- createFactory = ReactElementValidator.createFactory;
1666
- cloneElement = ReactElementValidator.cloneElement;
1667
- }
1399
+ var REACT_FRAGMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.fragment') || 0xeacb;
1668
1400
 
1669
1401
  var React = {
1670
1402
  Children: {
1671
- map: ReactChildren_1.map,
1672
- forEach: ReactChildren_1.forEach,
1673
- count: ReactChildren_1.count,
1674
- toArray: ReactChildren_1.toArray,
1675
- only: onlyChild_1
1403
+ map: mapChildren,
1404
+ forEach: forEachChildren,
1405
+ count: countChildren,
1406
+ toArray: toArray,
1407
+ only: onlyChild
1676
1408
  },
1677
1409
 
1678
- Component: ReactBaseClasses.Component,
1679
- PureComponent: ReactBaseClasses.PureComponent,
1680
- unstable_AsyncComponent: ReactBaseClasses.AsyncComponent,
1410
+ Component: Component,
1411
+ PureComponent: PureComponent,
1412
+ unstable_AsyncComponent: AsyncComponent,
1681
1413
 
1682
- createElement: createElement,
1683
- cloneElement: cloneElement,
1684
- isValidElement: ReactElement_1.isValidElement,
1685
-
1686
- createFactory: createFactory,
1414
+ createElement: createElementWithValidation,
1415
+ cloneElement: cloneElementWithValidation,
1416
+ createFactory: createFactoryWithValidation,
1417
+ isValidElement: isValidElement,
1687
1418
 
1688
1419
  version: ReactVersion,
1689
1420
 
1690
1421
  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
1691
- ReactCurrentOwner: ReactCurrentOwner_1
1422
+ ReactCurrentOwner: ReactCurrentOwner,
1423
+ // Used by renderers to avoid bundling object-assign twice in UMD bundles:
1424
+ assign: _assign
1692
1425
  }
1693
1426
  };
1694
1427
 
1428
+ if (ReactFeatureFlags.enableReactFragment) {
1429
+ React.Fragment = REACT_FRAGMENT_TYPE;
1430
+ }
1431
+
1695
1432
  {
1696
- 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, {
1697
1434
  // These should not be included in production.
1698
- ReactComponentTreeHook: ReactComponentTreeHook_1,
1699
- 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: {}
1700
1439
  });
1701
1440
  }
1702
1441
 
1703
- var ReactEntry = React;
1704
1442
 
1705
- 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;
1706
1468
 
1707
1469
  })();
1708
1470
  }