react 16.0.0-alpha.0 → 16.0.0-alpha.5
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/dist/react.js +513 -475
- package/dist/react.min.js +7 -2
- package/lib/React.js +7 -18
- package/lib/{ReactComponent.js → ReactBaseClasses.js} +27 -2
- package/lib/ReactClass.js +10 -15
- package/lib/ReactComponentTreeHook.js +8 -47
- package/lib/ReactCurrentOwner.js +0 -2
- package/lib/ReactDebugCurrentFrame.js +55 -0
- package/lib/ReactElementValidator.js +40 -24
- package/lib/ReactFiberComponentTreeHook.js +62 -0
- package/lib/ReactNoopUpdateQueue.js +1 -2
- package/lib/ReactPropTypes.js +31 -29
- package/lib/{ReactPropTypeLocations.js → ReactPropTypesSecret.js} +5 -1
- package/lib/ReactVersion.js +1 -1
- package/lib/checkPropTypes.js +64 -0
- package/lib/checkReactTypeSpec.js +5 -80
- package/lib/deprecated.js +1 -1
- package/lib/traverseAllChildren.js +17 -28
- package/package.json +2 -2
- package/dist/react-with-addons.js +0 -5307
- package/dist/react-with-addons.min.js +0 -12
- package/lib/ReactAddonsDOMDependencies.js +0 -36
- package/lib/ReactAddonsDOMDependenciesUMDShim.js +0 -35
- package/lib/ReactCSSTransitionGroup.js +0 -104
- package/lib/ReactCSSTransitionGroupChild.js +0 -166
- package/lib/ReactComponentWithPureRenderMixin.js +0 -47
- package/lib/ReactFragment.js +0 -68
- package/lib/ReactPropTypeLocationNames.js +0 -24
- package/lib/ReactPureComponent.js +0 -41
- package/lib/ReactStateSetters.js +0 -103
- package/lib/ReactTransitionChildMapping.js +0 -102
- package/lib/ReactTransitionEvents.js +0 -72
- package/lib/ReactTransitionGroup.js +0 -228
- package/lib/ReactWithAddons.js +0 -50
- package/lib/ReactWithAddonsUMDEntry.js +0 -32
- package/lib/shallowCompare.js +0 -24
- package/lib/sliceChildren.js +0 -33
- package/lib/update.js +0 -111
package/dist/react.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* React v16.0.0-alpha.
|
|
2
|
+
* React v16.0.0-alpha.5
|
|
3
3
|
*/
|
|
4
4
|
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.React = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
|
|
5
5
|
/**
|
|
@@ -74,9 +74,9 @@ module.exports = KeyEscapeUtils;
|
|
|
74
74
|
|
|
75
75
|
'use strict';
|
|
76
76
|
|
|
77
|
-
var _prodInvariant = _dereq_(
|
|
77
|
+
var _prodInvariant = _dereq_(27);
|
|
78
78
|
|
|
79
|
-
var invariant = _dereq_(
|
|
79
|
+
var invariant = _dereq_(31);
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
82
|
* Static poolers. Several custom versions for each potential number of
|
|
@@ -172,7 +172,7 @@ var PooledClass = {
|
|
|
172
172
|
};
|
|
173
173
|
|
|
174
174
|
module.exports = PooledClass;
|
|
175
|
-
},{"
|
|
175
|
+
},{"27":27,"31":31}],3:[function(_dereq_,module,exports){
|
|
176
176
|
/**
|
|
177
177
|
* Copyright 2013-present, Facebook, Inc.
|
|
178
178
|
* All rights reserved.
|
|
@@ -185,44 +185,35 @@ module.exports = PooledClass;
|
|
|
185
185
|
|
|
186
186
|
'use strict';
|
|
187
187
|
|
|
188
|
-
var
|
|
189
|
-
|
|
190
|
-
var
|
|
191
|
-
var ReactComponent = _dereq_(6);
|
|
192
|
-
var ReactPureComponent = _dereq_(16);
|
|
193
|
-
var ReactClass = _dereq_(5);
|
|
188
|
+
var ReactBaseClasses = _dereq_(4);
|
|
189
|
+
var ReactChildren = _dereq_(5);
|
|
190
|
+
var ReactClass = _dereq_(6);
|
|
194
191
|
var ReactDOMFactories = _dereq_(9);
|
|
195
|
-
var ReactElement = _dereq_(
|
|
196
|
-
var ReactPropTypes = _dereq_(
|
|
197
|
-
var ReactVersion = _dereq_(
|
|
192
|
+
var ReactElement = _dereq_(11);
|
|
193
|
+
var ReactPropTypes = _dereq_(16);
|
|
194
|
+
var ReactVersion = _dereq_(20);
|
|
198
195
|
|
|
199
|
-
var onlyChild = _dereq_(
|
|
200
|
-
var warning = _dereq_(
|
|
196
|
+
var onlyChild = _dereq_(26);
|
|
197
|
+
var warning = _dereq_(32);
|
|
198
|
+
var checkPropTypes = _dereq_(22);
|
|
201
199
|
|
|
202
200
|
var createElement = ReactElement.createElement;
|
|
203
201
|
var createFactory = ReactElement.createFactory;
|
|
204
202
|
var cloneElement = ReactElement.cloneElement;
|
|
205
203
|
|
|
206
204
|
if ("development" !== 'production') {
|
|
207
|
-
var ReactElementValidator = _dereq_(
|
|
205
|
+
var ReactElementValidator = _dereq_(13);
|
|
208
206
|
createElement = ReactElementValidator.createElement;
|
|
209
207
|
createFactory = ReactElementValidator.createFactory;
|
|
210
208
|
cloneElement = ReactElementValidator.cloneElement;
|
|
211
209
|
}
|
|
212
210
|
|
|
213
|
-
var __spread = _assign;
|
|
214
211
|
var createMixin = function (mixin) {
|
|
215
212
|
return mixin;
|
|
216
213
|
};
|
|
217
214
|
|
|
218
215
|
if ("development" !== 'production') {
|
|
219
|
-
var warnedForSpread = false;
|
|
220
216
|
var warnedForCreateMixin = false;
|
|
221
|
-
__spread = function () {
|
|
222
|
-
"development" !== 'production' ? warning(warnedForSpread, 'React.__spread is deprecated and should not be used. Use ' + 'Object.assign directly or another helper function with similar ' + 'semantics. You may be seeing this warning due to your compiler. ' + 'See https://fb.me/react-spread-deprecation for more details.') : void 0;
|
|
223
|
-
warnedForSpread = true;
|
|
224
|
-
return _assign.apply(null, arguments);
|
|
225
|
-
};
|
|
226
217
|
|
|
227
218
|
createMixin = function (mixin) {
|
|
228
219
|
"development" !== 'production' ? warning(warnedForCreateMixin, 'React.createMixin is deprecated and should not be used. You ' + 'can use this mixin directly instead.') : void 0;
|
|
@@ -232,7 +223,6 @@ if ("development" !== 'production') {
|
|
|
232
223
|
}
|
|
233
224
|
|
|
234
225
|
var React = {
|
|
235
|
-
|
|
236
226
|
// Modern
|
|
237
227
|
|
|
238
228
|
Children: {
|
|
@@ -243,13 +233,15 @@ var React = {
|
|
|
243
233
|
only: onlyChild
|
|
244
234
|
},
|
|
245
235
|
|
|
246
|
-
Component:
|
|
247
|
-
PureComponent:
|
|
236
|
+
Component: ReactBaseClasses.Component,
|
|
237
|
+
PureComponent: ReactBaseClasses.PureComponent,
|
|
248
238
|
|
|
249
239
|
createElement: createElement,
|
|
250
240
|
cloneElement: cloneElement,
|
|
251
241
|
isValidElement: ReactElement.isValidElement,
|
|
252
242
|
|
|
243
|
+
checkPropTypes: checkPropTypes,
|
|
244
|
+
|
|
253
245
|
// Classic
|
|
254
246
|
|
|
255
247
|
PropTypes: ReactPropTypes,
|
|
@@ -261,14 +253,148 @@ var React = {
|
|
|
261
253
|
// since they are just generating DOM strings.
|
|
262
254
|
DOM: ReactDOMFactories,
|
|
263
255
|
|
|
264
|
-
version: ReactVersion
|
|
265
|
-
|
|
266
|
-
// Deprecated hook for JSX spread, don't use this for anything.
|
|
267
|
-
__spread: __spread
|
|
256
|
+
version: ReactVersion
|
|
268
257
|
};
|
|
269
258
|
|
|
270
259
|
module.exports = React;
|
|
271
|
-
},{"
|
|
260
|
+
},{"11":11,"13":13,"16":16,"20":20,"22":22,"26":26,"32":32,"4":4,"5":5,"6":6,"9":9}],4:[function(_dereq_,module,exports){
|
|
261
|
+
/**
|
|
262
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
263
|
+
* All rights reserved.
|
|
264
|
+
*
|
|
265
|
+
* This source code is licensed under the BSD-style license found in the
|
|
266
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
267
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
268
|
+
*
|
|
269
|
+
*/
|
|
270
|
+
|
|
271
|
+
'use strict';
|
|
272
|
+
|
|
273
|
+
var _prodInvariant = _dereq_(27),
|
|
274
|
+
_assign = _dereq_(33);
|
|
275
|
+
|
|
276
|
+
var ReactNoopUpdateQueue = _dereq_(15);
|
|
277
|
+
|
|
278
|
+
var canDefineProperty = _dereq_(21);
|
|
279
|
+
var emptyObject = _dereq_(30);
|
|
280
|
+
var invariant = _dereq_(31);
|
|
281
|
+
var warning = _dereq_(32);
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Base class helpers for the updating state of a component.
|
|
285
|
+
*/
|
|
286
|
+
function ReactComponent(props, context, updater) {
|
|
287
|
+
this.props = props;
|
|
288
|
+
this.context = context;
|
|
289
|
+
this.refs = emptyObject;
|
|
290
|
+
// We initialize the default updater but the real one gets injected by the
|
|
291
|
+
// renderer.
|
|
292
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
ReactComponent.prototype.isReactComponent = {};
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Sets a subset of the state. Always use this to mutate
|
|
299
|
+
* state. You should treat `this.state` as immutable.
|
|
300
|
+
*
|
|
301
|
+
* There is no guarantee that `this.state` will be immediately updated, so
|
|
302
|
+
* accessing `this.state` after calling this method may return the old value.
|
|
303
|
+
*
|
|
304
|
+
* There is no guarantee that calls to `setState` will run synchronously,
|
|
305
|
+
* as they may eventually be batched together. You can provide an optional
|
|
306
|
+
* callback that will be executed when the call to setState is actually
|
|
307
|
+
* completed.
|
|
308
|
+
*
|
|
309
|
+
* When a function is provided to setState, it will be called at some point in
|
|
310
|
+
* the future (not synchronously). It will be called with the up to date
|
|
311
|
+
* component arguments (state, props, context). These values can be different
|
|
312
|
+
* from this.* because your function may be called after receiveProps but before
|
|
313
|
+
* shouldComponentUpdate, and this new state, props, and context will not yet be
|
|
314
|
+
* assigned to this.
|
|
315
|
+
*
|
|
316
|
+
* @param {object|function} partialState Next partial state or function to
|
|
317
|
+
* produce next partial state to be merged with current state.
|
|
318
|
+
* @param {?function} callback Called after state is updated.
|
|
319
|
+
* @final
|
|
320
|
+
* @protected
|
|
321
|
+
*/
|
|
322
|
+
ReactComponent.prototype.setState = function (partialState, callback) {
|
|
323
|
+
!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? "development" !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : _prodInvariant('85') : void 0;
|
|
324
|
+
this.updater.enqueueSetState(this, partialState, callback, 'setState');
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Forces an update. This should only be invoked when it is known with
|
|
329
|
+
* certainty that we are **not** in a DOM transaction.
|
|
330
|
+
*
|
|
331
|
+
* You may want to call this when you know that some deeper aspect of the
|
|
332
|
+
* component's state has changed but `setState` was not called.
|
|
333
|
+
*
|
|
334
|
+
* This will not invoke `shouldComponentUpdate`, but it will invoke
|
|
335
|
+
* `componentWillUpdate` and `componentDidUpdate`.
|
|
336
|
+
*
|
|
337
|
+
* @param {?function} callback Called after update is complete.
|
|
338
|
+
* @final
|
|
339
|
+
* @protected
|
|
340
|
+
*/
|
|
341
|
+
ReactComponent.prototype.forceUpdate = function (callback) {
|
|
342
|
+
this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Deprecated APIs. These APIs used to exist on classic React classes but since
|
|
347
|
+
* we would like to deprecate them, we're not going to move them over to this
|
|
348
|
+
* modern base class. Instead, we define a getter that warns if it's accessed.
|
|
349
|
+
*/
|
|
350
|
+
if ("development" !== 'production') {
|
|
351
|
+
var deprecatedAPIs = {
|
|
352
|
+
isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
|
|
353
|
+
replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
|
|
354
|
+
};
|
|
355
|
+
var defineDeprecationWarning = function (methodName, info) {
|
|
356
|
+
if (canDefineProperty) {
|
|
357
|
+
Object.defineProperty(ReactComponent.prototype, methodName, {
|
|
358
|
+
get: function () {
|
|
359
|
+
"development" !== 'production' ? warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]) : void 0;
|
|
360
|
+
return undefined;
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
};
|
|
365
|
+
for (var fnName in deprecatedAPIs) {
|
|
366
|
+
if (deprecatedAPIs.hasOwnProperty(fnName)) {
|
|
367
|
+
defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Base class helpers for the updating state of a component.
|
|
374
|
+
*/
|
|
375
|
+
function ReactPureComponent(props, context, updater) {
|
|
376
|
+
// Duplicated from ReactComponent.
|
|
377
|
+
this.props = props;
|
|
378
|
+
this.context = context;
|
|
379
|
+
this.refs = emptyObject;
|
|
380
|
+
// We initialize the default updater but the real one gets injected by the
|
|
381
|
+
// renderer.
|
|
382
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
function ComponentDummy() {}
|
|
386
|
+
ComponentDummy.prototype = ReactComponent.prototype;
|
|
387
|
+
ReactPureComponent.prototype = new ComponentDummy();
|
|
388
|
+
ReactPureComponent.prototype.constructor = ReactPureComponent;
|
|
389
|
+
// Avoid an extra prototype jump for these methods.
|
|
390
|
+
_assign(ReactPureComponent.prototype, ReactComponent.prototype);
|
|
391
|
+
ReactPureComponent.prototype.isPureReactComponent = true;
|
|
392
|
+
|
|
393
|
+
module.exports = {
|
|
394
|
+
Component: ReactComponent,
|
|
395
|
+
PureComponent: ReactPureComponent
|
|
396
|
+
};
|
|
397
|
+
},{"15":15,"21":21,"27":27,"30":30,"31":31,"32":32,"33":33}],5:[function(_dereq_,module,exports){
|
|
272
398
|
/**
|
|
273
399
|
* Copyright 2013-present, Facebook, Inc.
|
|
274
400
|
* All rights reserved.
|
|
@@ -282,10 +408,10 @@ module.exports = React;
|
|
|
282
408
|
'use strict';
|
|
283
409
|
|
|
284
410
|
var PooledClass = _dereq_(2);
|
|
285
|
-
var ReactElement = _dereq_(
|
|
411
|
+
var ReactElement = _dereq_(11);
|
|
286
412
|
|
|
287
|
-
var emptyFunction = _dereq_(
|
|
288
|
-
var traverseAllChildren = _dereq_(
|
|
413
|
+
var emptyFunction = _dereq_(29);
|
|
414
|
+
var traverseAllChildren = _dereq_(28);
|
|
289
415
|
|
|
290
416
|
var twoArgumentPooler = PooledClass.twoArgumentPooler;
|
|
291
417
|
var fourArgumentPooler = PooledClass.fourArgumentPooler;
|
|
@@ -459,7 +585,7 @@ var ReactChildren = {
|
|
|
459
585
|
};
|
|
460
586
|
|
|
461
587
|
module.exports = ReactChildren;
|
|
462
|
-
},{"
|
|
588
|
+
},{"11":11,"2":2,"28":28,"29":29}],6:[function(_dereq_,module,exports){
|
|
463
589
|
/**
|
|
464
590
|
* Copyright 2013-present, Facebook, Inc.
|
|
465
591
|
* All rights reserved.
|
|
@@ -472,17 +598,18 @@ module.exports = ReactChildren;
|
|
|
472
598
|
|
|
473
599
|
'use strict';
|
|
474
600
|
|
|
475
|
-
var
|
|
476
|
-
|
|
601
|
+
var _assign = _dereq_(33),
|
|
602
|
+
_prodInvariant = _dereq_(27);
|
|
603
|
+
|
|
604
|
+
var ReactBaseClasses = _dereq_(4);
|
|
605
|
+
var ReactElement = _dereq_(11);
|
|
606
|
+
var ReactNoopUpdateQueue = _dereq_(15);
|
|
477
607
|
|
|
478
|
-
var
|
|
479
|
-
var
|
|
480
|
-
var
|
|
481
|
-
var ReactNoopUpdateQueue = _dereq_(13);
|
|
608
|
+
var emptyObject = _dereq_(30);
|
|
609
|
+
var invariant = _dereq_(31);
|
|
610
|
+
var warning = _dereq_(32);
|
|
482
611
|
|
|
483
|
-
var
|
|
484
|
-
var invariant = _dereq_(29);
|
|
485
|
-
var warning = _dereq_(30);
|
|
612
|
+
var ReactComponent = ReactBaseClasses.Component;
|
|
486
613
|
|
|
487
614
|
var MIXINS_KEY = 'mixins';
|
|
488
615
|
|
|
@@ -520,7 +647,6 @@ function identity(fn) {
|
|
|
520
647
|
* @internal
|
|
521
648
|
*/
|
|
522
649
|
var ReactClassInterface = {
|
|
523
|
-
|
|
524
650
|
/**
|
|
525
651
|
* An array of Mixin objects to include when defining your component.
|
|
526
652
|
*
|
|
@@ -611,7 +737,6 @@ var ReactClassInterface = {
|
|
|
611
737
|
* }
|
|
612
738
|
*
|
|
613
739
|
* @return {ReactComponent}
|
|
614
|
-
* @nosideeffects
|
|
615
740
|
* @required
|
|
616
741
|
*/
|
|
617
742
|
render: 'DEFINE_ONCE',
|
|
@@ -739,7 +864,6 @@ var ReactClassInterface = {
|
|
|
739
864
|
* @overridable
|
|
740
865
|
*/
|
|
741
866
|
updateComponent: 'OVERRIDE_BASE'
|
|
742
|
-
|
|
743
867
|
};
|
|
744
868
|
|
|
745
869
|
/**
|
|
@@ -764,7 +888,7 @@ var RESERVED_SPEC_KEYS = {
|
|
|
764
888
|
},
|
|
765
889
|
childContextTypes: function (Constructor, childContextTypes) {
|
|
766
890
|
if ("development" !== 'production') {
|
|
767
|
-
validateTypeDef(Constructor, childContextTypes, '
|
|
891
|
+
validateTypeDef(Constructor, childContextTypes, 'child context');
|
|
768
892
|
}
|
|
769
893
|
Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes);
|
|
770
894
|
},
|
|
@@ -801,7 +925,7 @@ function validateTypeDef(Constructor, typeDef, location) {
|
|
|
801
925
|
if (typeDef.hasOwnProperty(propName)) {
|
|
802
926
|
// use a warning instead of an invariant so components
|
|
803
927
|
// don't show up in prod but only in __DEV__
|
|
804
|
-
"development" !== 'production' ? warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass',
|
|
928
|
+
"development" !== 'production' ? warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', location, propName) : void 0;
|
|
805
929
|
}
|
|
806
930
|
}
|
|
807
931
|
}
|
|
@@ -830,7 +954,7 @@ function mixSpecIntoComponent(Constructor, spec) {
|
|
|
830
954
|
var typeofSpec = typeof spec;
|
|
831
955
|
var isMixinValid = typeofSpec === 'object' && spec !== null;
|
|
832
956
|
|
|
833
|
-
"development" !== 'production' ? warning(isMixinValid,
|
|
957
|
+
"development" !== 'production' ? warning(isMixinValid, "%s: You're attempting to include a mixin that is either null " + 'or not an object. Check the mixins included by the component, ' + 'as well as any mixins they include themselves. ' + 'Expected object but got %s.', Constructor.displayName || 'ReactClass', spec === null ? null : typeofSpec) : void 0;
|
|
834
958
|
}
|
|
835
959
|
|
|
836
960
|
return;
|
|
@@ -1007,9 +1131,9 @@ function bindAutoBindMethod(component, method) {
|
|
|
1007
1131
|
// ignore the value of "this" that the user is trying to use, so
|
|
1008
1132
|
// let's warn.
|
|
1009
1133
|
if (newThis !== component && newThis !== null) {
|
|
1010
|
-
"development" !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance
|
|
1134
|
+
"development" !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance.\n\nSee %s', componentName) : void 0;
|
|
1011
1135
|
} else if (!args.length) {
|
|
1012
|
-
"development" !== 'production' ? warning(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call
|
|
1136
|
+
"development" !== 'production' ? warning(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call.\n\nSee %s', componentName) : void 0;
|
|
1013
1137
|
return boundMethod;
|
|
1014
1138
|
}
|
|
1015
1139
|
var reboundMethod = _bind.apply(boundMethod, arguments);
|
|
@@ -1041,7 +1165,6 @@ function bindAutoBindMethods(component) {
|
|
|
1041
1165
|
* therefore not already part of the modern ReactComponent.
|
|
1042
1166
|
*/
|
|
1043
1167
|
var ReactClassMixin = {
|
|
1044
|
-
|
|
1045
1168
|
/**
|
|
1046
1169
|
* TODO: This will be deprecated because state should always keep a consistent
|
|
1047
1170
|
* type signature and the only use case for this, is to avoid that.
|
|
@@ -1070,7 +1193,6 @@ _assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin
|
|
|
1070
1193
|
* @class ReactClass
|
|
1071
1194
|
*/
|
|
1072
1195
|
var ReactClass = {
|
|
1073
|
-
|
|
1074
1196
|
/**
|
|
1075
1197
|
* Creates a composite component class given a class specification.
|
|
1076
1198
|
* See https://facebook.github.io/react/docs/react-api.html#createclass
|
|
@@ -1159,123 +1281,10 @@ var ReactClass = {
|
|
|
1159
1281
|
|
|
1160
1282
|
return Constructor;
|
|
1161
1283
|
}
|
|
1162
|
-
|
|
1163
1284
|
};
|
|
1164
1285
|
|
|
1165
1286
|
module.exports = ReactClass;
|
|
1166
|
-
},{"
|
|
1167
|
-
/**
|
|
1168
|
-
* Copyright 2013-present, Facebook, Inc.
|
|
1169
|
-
* All rights reserved.
|
|
1170
|
-
*
|
|
1171
|
-
* This source code is licensed under the BSD-style license found in the
|
|
1172
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
1173
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
1174
|
-
*
|
|
1175
|
-
*/
|
|
1176
|
-
|
|
1177
|
-
'use strict';
|
|
1178
|
-
|
|
1179
|
-
var _prodInvariant = _dereq_(25);
|
|
1180
|
-
|
|
1181
|
-
var ReactNoopUpdateQueue = _dereq_(13);
|
|
1182
|
-
|
|
1183
|
-
var canDefineProperty = _dereq_(20);
|
|
1184
|
-
var emptyObject = _dereq_(28);
|
|
1185
|
-
var invariant = _dereq_(29);
|
|
1186
|
-
var warning = _dereq_(30);
|
|
1187
|
-
|
|
1188
|
-
/**
|
|
1189
|
-
* Base class helpers for the updating state of a component.
|
|
1190
|
-
*/
|
|
1191
|
-
function ReactComponent(props, context, updater) {
|
|
1192
|
-
this.props = props;
|
|
1193
|
-
this.context = context;
|
|
1194
|
-
this.refs = emptyObject;
|
|
1195
|
-
// We initialize the default updater but the real one gets injected by the
|
|
1196
|
-
// renderer.
|
|
1197
|
-
this.updater = updater || ReactNoopUpdateQueue;
|
|
1198
|
-
}
|
|
1199
|
-
|
|
1200
|
-
ReactComponent.prototype.isReactComponent = {};
|
|
1201
|
-
|
|
1202
|
-
/**
|
|
1203
|
-
* Sets a subset of the state. Always use this to mutate
|
|
1204
|
-
* state. You should treat `this.state` as immutable.
|
|
1205
|
-
*
|
|
1206
|
-
* There is no guarantee that `this.state` will be immediately updated, so
|
|
1207
|
-
* accessing `this.state` after calling this method may return the old value.
|
|
1208
|
-
*
|
|
1209
|
-
* There is no guarantee that calls to `setState` will run synchronously,
|
|
1210
|
-
* as they may eventually be batched together. You can provide an optional
|
|
1211
|
-
* callback that will be executed when the call to setState is actually
|
|
1212
|
-
* completed.
|
|
1213
|
-
*
|
|
1214
|
-
* When a function is provided to setState, it will be called at some point in
|
|
1215
|
-
* the future (not synchronously). It will be called with the up to date
|
|
1216
|
-
* component arguments (state, props, context). These values can be different
|
|
1217
|
-
* from this.* because your function may be called after receiveProps but before
|
|
1218
|
-
* shouldComponentUpdate, and this new state, props, and context will not yet be
|
|
1219
|
-
* assigned to this.
|
|
1220
|
-
*
|
|
1221
|
-
* @param {object|function} partialState Next partial state or function to
|
|
1222
|
-
* produce next partial state to be merged with current state.
|
|
1223
|
-
* @param {?function} callback Called after state is updated.
|
|
1224
|
-
* @final
|
|
1225
|
-
* @protected
|
|
1226
|
-
*/
|
|
1227
|
-
ReactComponent.prototype.setState = function (partialState, callback) {
|
|
1228
|
-
!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? "development" !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : _prodInvariant('85') : void 0;
|
|
1229
|
-
this.updater.enqueueSetState(this, partialState, callback, 'setState');
|
|
1230
|
-
};
|
|
1231
|
-
|
|
1232
|
-
/**
|
|
1233
|
-
* Forces an update. This should only be invoked when it is known with
|
|
1234
|
-
* certainty that we are **not** in a DOM transaction.
|
|
1235
|
-
*
|
|
1236
|
-
* You may want to call this when you know that some deeper aspect of the
|
|
1237
|
-
* component's state has changed but `setState` was not called.
|
|
1238
|
-
*
|
|
1239
|
-
* This will not invoke `shouldComponentUpdate`, but it will invoke
|
|
1240
|
-
* `componentWillUpdate` and `componentDidUpdate`.
|
|
1241
|
-
*
|
|
1242
|
-
* @param {?function} callback Called after update is complete.
|
|
1243
|
-
* @final
|
|
1244
|
-
* @protected
|
|
1245
|
-
*/
|
|
1246
|
-
ReactComponent.prototype.forceUpdate = function (callback) {
|
|
1247
|
-
this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
|
|
1248
|
-
};
|
|
1249
|
-
|
|
1250
|
-
/**
|
|
1251
|
-
* Deprecated APIs. These APIs used to exist on classic React classes but since
|
|
1252
|
-
* we would like to deprecate them, we're not going to move them over to this
|
|
1253
|
-
* modern base class. Instead, we define a getter that warns if it's accessed.
|
|
1254
|
-
*/
|
|
1255
|
-
if ("development" !== 'production') {
|
|
1256
|
-
var deprecatedAPIs = {
|
|
1257
|
-
isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
|
|
1258
|
-
replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
|
|
1259
|
-
};
|
|
1260
|
-
var defineDeprecationWarning = function (methodName, info) {
|
|
1261
|
-
if (canDefineProperty) {
|
|
1262
|
-
Object.defineProperty(ReactComponent.prototype, methodName, {
|
|
1263
|
-
get: function () {
|
|
1264
|
-
"development" !== 'production' ? warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]) : void 0;
|
|
1265
|
-
return undefined;
|
|
1266
|
-
}
|
|
1267
|
-
});
|
|
1268
|
-
}
|
|
1269
|
-
};
|
|
1270
|
-
for (var fnName in deprecatedAPIs) {
|
|
1271
|
-
if (deprecatedAPIs.hasOwnProperty(fnName)) {
|
|
1272
|
-
defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
|
1273
|
-
}
|
|
1274
|
-
}
|
|
1275
|
-
}
|
|
1276
|
-
|
|
1277
|
-
module.exports = ReactComponent;
|
|
1278
|
-
},{"13":13,"20":20,"25":25,"28":28,"29":29,"30":30}],7:[function(_dereq_,module,exports){
|
|
1287
|
+
},{"11":11,"15":15,"27":27,"30":30,"31":31,"32":32,"33":33,"4":4}],7:[function(_dereq_,module,exports){
|
|
1279
1288
|
/**
|
|
1280
1289
|
* Copyright 2016-present, Facebook, Inc.
|
|
1281
1290
|
* All rights reserved.
|
|
@@ -1289,19 +1298,17 @@ module.exports = ReactComponent;
|
|
|
1289
1298
|
|
|
1290
1299
|
'use strict';
|
|
1291
1300
|
|
|
1292
|
-
var _prodInvariant = _dereq_(
|
|
1301
|
+
var _prodInvariant = _dereq_(27);
|
|
1293
1302
|
|
|
1294
1303
|
var ReactCurrentOwner = _dereq_(8);
|
|
1295
|
-
var ReactTypeOfWork = _dereq_(17);
|
|
1296
|
-
var IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent,
|
|
1297
|
-
FunctionalComponent = ReactTypeOfWork.FunctionalComponent,
|
|
1298
|
-
ClassComponent = ReactTypeOfWork.ClassComponent,
|
|
1299
|
-
HostComponent = ReactTypeOfWork.HostComponent;
|
|
1300
1304
|
|
|
1305
|
+
var _require = _dereq_(14),
|
|
1306
|
+
getStackAddendumByWorkInProgressFiber = _require.getStackAddendumByWorkInProgressFiber,
|
|
1307
|
+
describeComponentFrame = _require.describeComponentFrame;
|
|
1301
1308
|
|
|
1302
|
-
var
|
|
1303
|
-
var
|
|
1304
|
-
var
|
|
1309
|
+
var invariant = _dereq_(31);
|
|
1310
|
+
var warning = _dereq_(32);
|
|
1311
|
+
var getComponentName = _dereq_(24);
|
|
1305
1312
|
|
|
1306
1313
|
function isNative(fn) {
|
|
1307
1314
|
// Based on isNative() from Lodash
|
|
@@ -1422,10 +1429,6 @@ function purgeDeep(id) {
|
|
|
1422
1429
|
}
|
|
1423
1430
|
}
|
|
1424
1431
|
|
|
1425
|
-
function describeComponentFrame(name, source, ownerName) {
|
|
1426
|
-
return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
|
|
1427
|
-
}
|
|
1428
|
-
|
|
1429
1432
|
function getDisplayName(element) {
|
|
1430
1433
|
if (element == null) {
|
|
1431
1434
|
return '#empty';
|
|
@@ -1442,31 +1445,13 @@ function describeID(id) {
|
|
|
1442
1445
|
var name = ReactComponentTreeHook.getDisplayName(id);
|
|
1443
1446
|
var element = ReactComponentTreeHook.getElement(id);
|
|
1444
1447
|
var ownerID = ReactComponentTreeHook.getOwnerID(id);
|
|
1445
|
-
var ownerName;
|
|
1448
|
+
var ownerName = void 0;
|
|
1449
|
+
|
|
1446
1450
|
if (ownerID) {
|
|
1447
1451
|
ownerName = ReactComponentTreeHook.getDisplayName(ownerID);
|
|
1448
1452
|
}
|
|
1449
1453
|
"development" !== 'production' ? warning(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id) : void 0;
|
|
1450
|
-
return describeComponentFrame(name, element && element._source, ownerName);
|
|
1451
|
-
}
|
|
1452
|
-
|
|
1453
|
-
function describeFiber(fiber) {
|
|
1454
|
-
switch (fiber.tag) {
|
|
1455
|
-
case IndeterminateComponent:
|
|
1456
|
-
case FunctionalComponent:
|
|
1457
|
-
case ClassComponent:
|
|
1458
|
-
case HostComponent:
|
|
1459
|
-
var owner = fiber._debugOwner;
|
|
1460
|
-
var source = fiber._debugSource;
|
|
1461
|
-
var name = getComponentName(fiber);
|
|
1462
|
-
var ownerName = null;
|
|
1463
|
-
if (owner) {
|
|
1464
|
-
ownerName = getComponentName(owner);
|
|
1465
|
-
}
|
|
1466
|
-
return describeComponentFrame(name, source, ownerName);
|
|
1467
|
-
default:
|
|
1468
|
-
return '';
|
|
1469
|
-
}
|
|
1454
|
+
return describeComponentFrame(name || '', element && element._source, ownerName || '');
|
|
1470
1455
|
}
|
|
1471
1456
|
|
|
1472
1457
|
var ReactComponentTreeHook = {
|
|
@@ -1574,7 +1559,7 @@ var ReactComponentTreeHook = {
|
|
|
1574
1559
|
var workInProgress = currentOwner;
|
|
1575
1560
|
// Safe because if current owner exists, we are reconciling,
|
|
1576
1561
|
// and it is guaranteed to be the work-in-progress version.
|
|
1577
|
-
info +=
|
|
1562
|
+
info += getStackAddendumByWorkInProgressFiber(workInProgress);
|
|
1578
1563
|
} else if (typeof currentOwner._debugID === 'number') {
|
|
1579
1564
|
info += ReactComponentTreeHook.getStackAddendumByID(currentOwner._debugID);
|
|
1580
1565
|
}
|
|
@@ -1589,21 +1574,6 @@ var ReactComponentTreeHook = {
|
|
|
1589
1574
|
}
|
|
1590
1575
|
return info;
|
|
1591
1576
|
},
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
// This function can only be called with a work-in-progress fiber and
|
|
1595
|
-
// only during begin or complete phase. Do not call it under any other
|
|
1596
|
-
// circumstances.
|
|
1597
|
-
getStackAddendumByWorkInProgressFiber: function (workInProgress) {
|
|
1598
|
-
var info = '';
|
|
1599
|
-
var node = workInProgress;
|
|
1600
|
-
do {
|
|
1601
|
-
info += describeFiber(node);
|
|
1602
|
-
// Otherwise this return pointer might point to the wrong tree:
|
|
1603
|
-
node = node['return'];
|
|
1604
|
-
} while (node);
|
|
1605
|
-
return info;
|
|
1606
|
-
},
|
|
1607
1577
|
getChildIDs: function (id) {
|
|
1608
1578
|
var item = getItem(id);
|
|
1609
1579
|
return item ? item.childIDs : [];
|
|
@@ -1657,7 +1627,7 @@ var ReactComponentTreeHook = {
|
|
|
1657
1627
|
};
|
|
1658
1628
|
|
|
1659
1629
|
module.exports = ReactComponentTreeHook;
|
|
1660
|
-
},{"
|
|
1630
|
+
},{"14":14,"24":24,"27":27,"31":31,"32":32,"8":8}],8:[function(_dereq_,module,exports){
|
|
1661
1631
|
/**
|
|
1662
1632
|
* Copyright 2013-present, Facebook, Inc.
|
|
1663
1633
|
* All rights reserved.
|
|
@@ -1678,13 +1648,11 @@ module.exports = ReactComponentTreeHook;
|
|
|
1678
1648
|
* currently being constructed.
|
|
1679
1649
|
*/
|
|
1680
1650
|
var ReactCurrentOwner = {
|
|
1681
|
-
|
|
1682
1651
|
/**
|
|
1683
1652
|
* @internal
|
|
1684
1653
|
* @type {ReactComponent}
|
|
1685
1654
|
*/
|
|
1686
1655
|
current: null
|
|
1687
|
-
|
|
1688
1656
|
};
|
|
1689
1657
|
|
|
1690
1658
|
module.exports = ReactCurrentOwner;
|
|
@@ -1701,7 +1669,7 @@ module.exports = ReactCurrentOwner;
|
|
|
1701
1669
|
|
|
1702
1670
|
'use strict';
|
|
1703
1671
|
|
|
1704
|
-
var ReactElement = _dereq_(
|
|
1672
|
+
var ReactElement = _dereq_(11);
|
|
1705
1673
|
|
|
1706
1674
|
/**
|
|
1707
1675
|
* Create a factory that creates HTML tag elements.
|
|
@@ -1710,7 +1678,7 @@ var ReactElement = _dereq_(10);
|
|
|
1710
1678
|
*/
|
|
1711
1679
|
var createDOMFactory = ReactElement.createFactory;
|
|
1712
1680
|
if ("development" !== 'production') {
|
|
1713
|
-
var ReactElementValidator = _dereq_(
|
|
1681
|
+
var ReactElementValidator = _dereq_(13);
|
|
1714
1682
|
createDOMFactory = ReactElementValidator.createFactory;
|
|
1715
1683
|
}
|
|
1716
1684
|
|
|
@@ -1858,7 +1826,63 @@ var ReactDOMFactories = {
|
|
|
1858
1826
|
};
|
|
1859
1827
|
|
|
1860
1828
|
module.exports = ReactDOMFactories;
|
|
1861
|
-
},{"
|
|
1829
|
+
},{"11":11,"13":13}],10:[function(_dereq_,module,exports){
|
|
1830
|
+
/**
|
|
1831
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
1832
|
+
* All rights reserved.
|
|
1833
|
+
*
|
|
1834
|
+
* This source code is licensed under the BSD-style license found in the
|
|
1835
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
1836
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
1837
|
+
*
|
|
1838
|
+
*
|
|
1839
|
+
*/
|
|
1840
|
+
|
|
1841
|
+
'use strict';
|
|
1842
|
+
|
|
1843
|
+
var ReactDebugCurrentFrame = {};
|
|
1844
|
+
|
|
1845
|
+
if ("development" !== 'production') {
|
|
1846
|
+
var _require = _dereq_(7),
|
|
1847
|
+
getStackAddendumByID = _require.getStackAddendumByID,
|
|
1848
|
+
getCurrentStackAddendum = _require.getCurrentStackAddendum;
|
|
1849
|
+
|
|
1850
|
+
var _require2 = _dereq_(14),
|
|
1851
|
+
getStackAddendumByWorkInProgressFiber = _require2.getStackAddendumByWorkInProgressFiber;
|
|
1852
|
+
|
|
1853
|
+
// Component that is being worked on
|
|
1854
|
+
|
|
1855
|
+
|
|
1856
|
+
ReactDebugCurrentFrame.current = null;
|
|
1857
|
+
|
|
1858
|
+
// Element that is being cloned or created
|
|
1859
|
+
ReactDebugCurrentFrame.element = null;
|
|
1860
|
+
|
|
1861
|
+
ReactDebugCurrentFrame.getStackAddendum = function () {
|
|
1862
|
+
var stack = null;
|
|
1863
|
+
var current = ReactDebugCurrentFrame.current;
|
|
1864
|
+
var element = ReactDebugCurrentFrame.element;
|
|
1865
|
+
if (current !== null) {
|
|
1866
|
+
if (typeof current === 'number') {
|
|
1867
|
+
// DebugID from Stack.
|
|
1868
|
+
var debugID = current;
|
|
1869
|
+
stack = getStackAddendumByID(debugID);
|
|
1870
|
+
} else if (typeof current.tag === 'number') {
|
|
1871
|
+
// This is a Fiber.
|
|
1872
|
+
// The stack will only be correct if this is a work in progress
|
|
1873
|
+
// version and we're calling it during reconciliation.
|
|
1874
|
+
var workInProgress = current;
|
|
1875
|
+
stack = getStackAddendumByWorkInProgressFiber(workInProgress);
|
|
1876
|
+
}
|
|
1877
|
+
} else if (element !== null) {
|
|
1878
|
+
stack = getCurrentStackAddendum(element);
|
|
1879
|
+
}
|
|
1880
|
+
return stack;
|
|
1881
|
+
};
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1884
|
+
module.exports = ReactDebugCurrentFrame;
|
|
1885
|
+
},{"14":14,"7":7}],11:[function(_dereq_,module,exports){
|
|
1862
1886
|
/**
|
|
1863
1887
|
* Copyright 2014-present, Facebook, Inc.
|
|
1864
1888
|
* All rights reserved.
|
|
@@ -1871,15 +1895,15 @@ module.exports = ReactDOMFactories;
|
|
|
1871
1895
|
|
|
1872
1896
|
'use strict';
|
|
1873
1897
|
|
|
1874
|
-
var _assign = _dereq_(
|
|
1898
|
+
var _assign = _dereq_(33);
|
|
1875
1899
|
|
|
1876
1900
|
var ReactCurrentOwner = _dereq_(8);
|
|
1877
1901
|
|
|
1878
|
-
var warning = _dereq_(
|
|
1879
|
-
var canDefineProperty = _dereq_(
|
|
1902
|
+
var warning = _dereq_(32);
|
|
1903
|
+
var canDefineProperty = _dereq_(21);
|
|
1880
1904
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1881
1905
|
|
|
1882
|
-
var REACT_ELEMENT_TYPE = _dereq_(
|
|
1906
|
+
var REACT_ELEMENT_TYPE = _dereq_(12);
|
|
1883
1907
|
|
|
1884
1908
|
var RESERVED_PROPS = {
|
|
1885
1909
|
key: true,
|
|
@@ -2199,7 +2223,7 @@ ReactElement.isValidElement = function (object) {
|
|
|
2199
2223
|
};
|
|
2200
2224
|
|
|
2201
2225
|
module.exports = ReactElement;
|
|
2202
|
-
},{"
|
|
2226
|
+
},{"12":12,"21":21,"32":32,"33":33,"8":8}],12:[function(_dereq_,module,exports){
|
|
2203
2227
|
/**
|
|
2204
2228
|
* Copyright 2014-present, Facebook, Inc.
|
|
2205
2229
|
* All rights reserved.
|
|
@@ -2219,7 +2243,7 @@ module.exports = ReactElement;
|
|
|
2219
2243
|
var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
|
|
2220
2244
|
|
|
2221
2245
|
module.exports = REACT_ELEMENT_TYPE;
|
|
2222
|
-
},{}],
|
|
2246
|
+
},{}],13:[function(_dereq_,module,exports){
|
|
2223
2247
|
/**
|
|
2224
2248
|
* Copyright 2014-present, Facebook, Inc.
|
|
2225
2249
|
* All rights reserved.
|
|
@@ -2240,21 +2264,27 @@ module.exports = REACT_ELEMENT_TYPE;
|
|
|
2240
2264
|
'use strict';
|
|
2241
2265
|
|
|
2242
2266
|
var ReactCurrentOwner = _dereq_(8);
|
|
2243
|
-
var
|
|
2244
|
-
var ReactElement = _dereq_(10);
|
|
2267
|
+
var ReactElement = _dereq_(11);
|
|
2245
2268
|
|
|
2246
|
-
var checkReactTypeSpec = _dereq_(
|
|
2269
|
+
var checkReactTypeSpec = _dereq_(23);
|
|
2247
2270
|
|
|
2248
|
-
var canDefineProperty = _dereq_(
|
|
2249
|
-
var getComponentName = _dereq_(
|
|
2250
|
-
var getIteratorFn = _dereq_(
|
|
2251
|
-
|
|
2271
|
+
var canDefineProperty = _dereq_(21);
|
|
2272
|
+
var getComponentName = _dereq_(24);
|
|
2273
|
+
var getIteratorFn = _dereq_(25);
|
|
2274
|
+
|
|
2275
|
+
if ("development" !== 'production') {
|
|
2276
|
+
var warning = _dereq_(32);
|
|
2277
|
+
var ReactDebugCurrentFrame = _dereq_(10);
|
|
2278
|
+
|
|
2279
|
+
var _require = _dereq_(7),
|
|
2280
|
+
getCurrentStackAddendum = _require.getCurrentStackAddendum;
|
|
2281
|
+
}
|
|
2252
2282
|
|
|
2253
2283
|
function getDeclarationErrorAddendum() {
|
|
2254
2284
|
if (ReactCurrentOwner.current) {
|
|
2255
2285
|
var name = getComponentName(ReactCurrentOwner.current);
|
|
2256
2286
|
if (name) {
|
|
2257
|
-
return '
|
|
2287
|
+
return '\n\nCheck the render method of `' + name + '`.';
|
|
2258
2288
|
}
|
|
2259
2289
|
}
|
|
2260
2290
|
return '';
|
|
@@ -2265,7 +2295,7 @@ function getSourceInfoErrorAddendum(elementProps) {
|
|
|
2265
2295
|
var source = elementProps.__source;
|
|
2266
2296
|
var fileName = source.fileName.replace(/^.*[\\\/]/, '');
|
|
2267
2297
|
var lineNumber = source.lineNumber;
|
|
2268
|
-
return '
|
|
2298
|
+
return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
|
|
2269
2299
|
}
|
|
2270
2300
|
return '';
|
|
2271
2301
|
}
|
|
@@ -2283,7 +2313,7 @@ function getCurrentComponentErrorInfo(parentType) {
|
|
|
2283
2313
|
if (!info) {
|
|
2284
2314
|
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
|
2285
2315
|
if (parentName) {
|
|
2286
|
-
info = '
|
|
2316
|
+
info = '\n\nCheck the top-level render call using <' + parentName + '>.';
|
|
2287
2317
|
}
|
|
2288
2318
|
}
|
|
2289
2319
|
return info;
|
|
@@ -2323,7 +2353,7 @@ function validateExplicitKey(element, parentType) {
|
|
|
2323
2353
|
childOwner = ' It was passed a child from ' + getComponentName(element._owner) + '.';
|
|
2324
2354
|
}
|
|
2325
2355
|
|
|
2326
|
-
"development" !== 'production' ? 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,
|
|
2356
|
+
"development" !== 'production' ? 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, getCurrentStackAddendum(element)) : void 0;
|
|
2327
2357
|
}
|
|
2328
2358
|
|
|
2329
2359
|
/**
|
|
@@ -2381,7 +2411,7 @@ function validatePropTypes(element) {
|
|
|
2381
2411
|
}
|
|
2382
2412
|
var name = componentClass.displayName || componentClass.name;
|
|
2383
2413
|
if (componentClass.propTypes) {
|
|
2384
|
-
checkReactTypeSpec(componentClass.propTypes, element.props, 'prop', name
|
|
2414
|
+
checkReactTypeSpec(componentClass.propTypes, element.props, 'prop', name);
|
|
2385
2415
|
}
|
|
2386
2416
|
if (typeof componentClass.getDefaultProps === 'function') {
|
|
2387
2417
|
"development" !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
|
|
@@ -2389,29 +2419,26 @@ function validatePropTypes(element) {
|
|
|
2389
2419
|
}
|
|
2390
2420
|
|
|
2391
2421
|
var ReactElementValidator = {
|
|
2392
|
-
|
|
2393
2422
|
createElement: function (type, props, children) {
|
|
2394
|
-
var validType = typeof type === 'string' || typeof type === 'function'
|
|
2423
|
+
var validType = typeof type === 'string' || typeof type === 'function';
|
|
2395
2424
|
// We warn in this case but don't throw. We expect the element creation to
|
|
2396
2425
|
// succeed and there will likely be errors in render.
|
|
2397
2426
|
if (!validType) {
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
}
|
|
2427
|
+
var info = '';
|
|
2428
|
+
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
|
2429
|
+
info += ' You likely forgot to export your component from the file ' + "it's defined in.";
|
|
2430
|
+
}
|
|
2403
2431
|
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2432
|
+
var sourceInfo = getSourceInfoErrorAddendum(props);
|
|
2433
|
+
if (sourceInfo) {
|
|
2434
|
+
info += sourceInfo;
|
|
2435
|
+
} else {
|
|
2436
|
+
info += getDeclarationErrorAddendum();
|
|
2437
|
+
}
|
|
2410
2438
|
|
|
2411
|
-
|
|
2439
|
+
info += getCurrentStackAddendum();
|
|
2412
2440
|
|
|
2413
|
-
|
|
2414
|
-
}
|
|
2441
|
+
"development" !== 'production' ? 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) : void 0;
|
|
2415
2442
|
}
|
|
2416
2443
|
|
|
2417
2444
|
var element = ReactElement.createElement.apply(this, arguments);
|
|
@@ -2422,6 +2449,10 @@ var ReactElementValidator = {
|
|
|
2422
2449
|
return element;
|
|
2423
2450
|
}
|
|
2424
2451
|
|
|
2452
|
+
if ("development" !== 'production') {
|
|
2453
|
+
ReactDebugCurrentFrame.element = element;
|
|
2454
|
+
}
|
|
2455
|
+
|
|
2425
2456
|
// Skip key warning if the type isn't valid since our key validation logic
|
|
2426
2457
|
// doesn't expect a non-string/function type and can throw confusing errors.
|
|
2427
2458
|
// We don't want exception behavior to differ between dev and prod.
|
|
@@ -2435,6 +2466,10 @@ var ReactElementValidator = {
|
|
|
2435
2466
|
|
|
2436
2467
|
validatePropTypes(element);
|
|
2437
2468
|
|
|
2469
|
+
if ("development" !== 'production') {
|
|
2470
|
+
ReactDebugCurrentFrame.element = null;
|
|
2471
|
+
}
|
|
2472
|
+
|
|
2438
2473
|
return element;
|
|
2439
2474
|
},
|
|
2440
2475
|
|
|
@@ -2463,17 +2498,85 @@ var ReactElementValidator = {
|
|
|
2463
2498
|
|
|
2464
2499
|
cloneElement: function (element, props, children) {
|
|
2465
2500
|
var newElement = ReactElement.cloneElement.apply(this, arguments);
|
|
2501
|
+
if ("development" !== 'production') {
|
|
2502
|
+
ReactDebugCurrentFrame.element = newElement;
|
|
2503
|
+
}
|
|
2466
2504
|
for (var i = 2; i < arguments.length; i++) {
|
|
2467
2505
|
validateChildKeys(arguments[i], newElement.type);
|
|
2468
2506
|
}
|
|
2469
2507
|
validatePropTypes(newElement);
|
|
2508
|
+
if ("development" !== 'production') {
|
|
2509
|
+
ReactDebugCurrentFrame.element = null;
|
|
2510
|
+
}
|
|
2470
2511
|
return newElement;
|
|
2471
2512
|
}
|
|
2472
|
-
|
|
2473
2513
|
};
|
|
2474
2514
|
|
|
2475
2515
|
module.exports = ReactElementValidator;
|
|
2476
|
-
},{"10":10,"
|
|
2516
|
+
},{"10":10,"11":11,"21":21,"23":23,"24":24,"25":25,"32":32,"7":7,"8":8}],14:[function(_dereq_,module,exports){
|
|
2517
|
+
/**
|
|
2518
|
+
* Copyright 2016-present, Facebook, Inc.
|
|
2519
|
+
* All rights reserved.
|
|
2520
|
+
*
|
|
2521
|
+
* This source code is licensed under the BSD-style license found in the
|
|
2522
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
2523
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
2524
|
+
*
|
|
2525
|
+
*
|
|
2526
|
+
*/
|
|
2527
|
+
|
|
2528
|
+
'use strict';
|
|
2529
|
+
|
|
2530
|
+
var ReactTypeOfWork = _dereq_(18);
|
|
2531
|
+
var IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent,
|
|
2532
|
+
FunctionalComponent = ReactTypeOfWork.FunctionalComponent,
|
|
2533
|
+
ClassComponent = ReactTypeOfWork.ClassComponent,
|
|
2534
|
+
HostComponent = ReactTypeOfWork.HostComponent;
|
|
2535
|
+
|
|
2536
|
+
var getComponentName = _dereq_(24);
|
|
2537
|
+
|
|
2538
|
+
function describeComponentFrame(name, source, ownerName) {
|
|
2539
|
+
return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
|
|
2540
|
+
}
|
|
2541
|
+
|
|
2542
|
+
function describeFiber(fiber) {
|
|
2543
|
+
switch (fiber.tag) {
|
|
2544
|
+
case IndeterminateComponent:
|
|
2545
|
+
case FunctionalComponent:
|
|
2546
|
+
case ClassComponent:
|
|
2547
|
+
case HostComponent:
|
|
2548
|
+
var owner = fiber._debugOwner;
|
|
2549
|
+
var source = fiber._debugSource;
|
|
2550
|
+
var name = getComponentName(fiber);
|
|
2551
|
+
var ownerName = null;
|
|
2552
|
+
if (owner) {
|
|
2553
|
+
ownerName = getComponentName(owner);
|
|
2554
|
+
}
|
|
2555
|
+
return describeComponentFrame(name, source, ownerName);
|
|
2556
|
+
default:
|
|
2557
|
+
return '';
|
|
2558
|
+
}
|
|
2559
|
+
}
|
|
2560
|
+
|
|
2561
|
+
// This function can only be called with a work-in-progress fiber and
|
|
2562
|
+
// only during begin or complete phase. Do not call it under any other
|
|
2563
|
+
// circumstances.
|
|
2564
|
+
function getStackAddendumByWorkInProgressFiber(workInProgress) {
|
|
2565
|
+
var info = '';
|
|
2566
|
+
var node = workInProgress;
|
|
2567
|
+
do {
|
|
2568
|
+
info += describeFiber(node);
|
|
2569
|
+
// Otherwise this return pointer might point to the wrong tree:
|
|
2570
|
+
node = node['return'];
|
|
2571
|
+
} while (node);
|
|
2572
|
+
return info;
|
|
2573
|
+
}
|
|
2574
|
+
|
|
2575
|
+
module.exports = {
|
|
2576
|
+
getStackAddendumByWorkInProgressFiber: getStackAddendumByWorkInProgressFiber,
|
|
2577
|
+
describeComponentFrame: describeComponentFrame
|
|
2578
|
+
};
|
|
2579
|
+
},{"18":18,"24":24}],15:[function(_dereq_,module,exports){
|
|
2477
2580
|
/**
|
|
2478
2581
|
* Copyright 2015-present, Facebook, Inc.
|
|
2479
2582
|
* All rights reserved.
|
|
@@ -2486,12 +2589,12 @@ module.exports = ReactElementValidator;
|
|
|
2486
2589
|
|
|
2487
2590
|
'use strict';
|
|
2488
2591
|
|
|
2489
|
-
var warning = _dereq_(
|
|
2592
|
+
var warning = _dereq_(32);
|
|
2490
2593
|
|
|
2491
2594
|
function warnNoop(publicInstance, callerName) {
|
|
2492
2595
|
if ("development" !== 'production') {
|
|
2493
2596
|
var constructor = publicInstance.constructor;
|
|
2494
|
-
"development" !== 'production' ? 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
|
|
2597
|
+
"development" !== 'production' ? 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') : void 0;
|
|
2495
2598
|
}
|
|
2496
2599
|
}
|
|
2497
2600
|
|
|
@@ -2499,7 +2602,6 @@ function warnNoop(publicInstance, callerName) {
|
|
|
2499
2602
|
* This is the abstract API for an update queue.
|
|
2500
2603
|
*/
|
|
2501
2604
|
var ReactNoopUpdateQueue = {
|
|
2502
|
-
|
|
2503
2605
|
/**
|
|
2504
2606
|
* Checks whether or not this composite component is mounted.
|
|
2505
2607
|
* @param {ReactClass} publicInstance The instance we want to test.
|
|
@@ -2565,7 +2667,7 @@ var ReactNoopUpdateQueue = {
|
|
|
2565
2667
|
};
|
|
2566
2668
|
|
|
2567
2669
|
module.exports = ReactNoopUpdateQueue;
|
|
2568
|
-
},{"
|
|
2670
|
+
},{"32":32}],16:[function(_dereq_,module,exports){
|
|
2569
2671
|
/**
|
|
2570
2672
|
* Copyright 2013-present, Facebook, Inc.
|
|
2571
2673
|
* All rights reserved.
|
|
@@ -2574,44 +2676,19 @@ module.exports = ReactNoopUpdateQueue;
|
|
|
2574
2676
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
2575
2677
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
2576
2678
|
*
|
|
2577
|
-
*
|
|
2578
2679
|
*/
|
|
2579
2680
|
|
|
2580
2681
|
'use strict';
|
|
2581
2682
|
|
|
2582
|
-
var
|
|
2683
|
+
var _prodInvariant = _dereq_(27);
|
|
2583
2684
|
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
prop: 'prop',
|
|
2587
|
-
context: 'context',
|
|
2588
|
-
childContext: 'child context'
|
|
2589
|
-
};
|
|
2590
|
-
}
|
|
2685
|
+
var ReactElement = _dereq_(11);
|
|
2686
|
+
var ReactPropTypesSecret = _dereq_(17);
|
|
2591
2687
|
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
* All rights reserved.
|
|
2597
|
-
*
|
|
2598
|
-
* This source code is licensed under the BSD-style license found in the
|
|
2599
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
2600
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
2601
|
-
*
|
|
2602
|
-
*/
|
|
2603
|
-
|
|
2604
|
-
'use strict';
|
|
2605
|
-
|
|
2606
|
-
var _prodInvariant = _dereq_(25);
|
|
2607
|
-
|
|
2608
|
-
var ReactElement = _dereq_(10);
|
|
2609
|
-
var ReactPropTypeLocationNames = _dereq_(14);
|
|
2610
|
-
|
|
2611
|
-
var emptyFunction = _dereq_(27);
|
|
2612
|
-
var getIteratorFn = _dereq_(23);
|
|
2613
|
-
var invariant = _dereq_(29);
|
|
2614
|
-
var warning = _dereq_(30);
|
|
2688
|
+
var emptyFunction = _dereq_(29);
|
|
2689
|
+
var getIteratorFn = _dereq_(25);
|
|
2690
|
+
var invariant = _dereq_(31);
|
|
2691
|
+
var warning = _dereq_(32);
|
|
2615
2692
|
|
|
2616
2693
|
/**
|
|
2617
2694
|
* Collection of methods that allow declaration and validation of props that are
|
|
@@ -2687,7 +2764,7 @@ if ("development" !== 'production') {
|
|
|
2687
2764
|
};
|
|
2688
2765
|
} else {
|
|
2689
2766
|
var productionTypeChecker = function () {
|
|
2690
|
-
invariant(false, 'React.PropTypes type checking code is stripped in production.');
|
|
2767
|
+
!false ? "development" !== 'production' ? invariant(false, 'React.PropTypes type checking code is stripped in production.') : _prodInvariant('144') : void 0;
|
|
2691
2768
|
};
|
|
2692
2769
|
productionTypeChecker.isRequired = productionTypeChecker;
|
|
2693
2770
|
var getProductionTypeChecker = function () {
|
|
@@ -2748,16 +2825,27 @@ function PropTypeError(message) {
|
|
|
2748
2825
|
PropTypeError.prototype = Error.prototype;
|
|
2749
2826
|
|
|
2750
2827
|
function createChainableTypeChecker(validate) {
|
|
2751
|
-
|
|
2828
|
+
if ("development" !== 'production') {
|
|
2829
|
+
var manualPropTypeCallCache = {};
|
|
2830
|
+
}
|
|
2831
|
+
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
2752
2832
|
componentName = componentName || ANONYMOUS;
|
|
2753
2833
|
propFullName = propFullName || propName;
|
|
2834
|
+
if ("development" !== 'production') {
|
|
2835
|
+
if (secret !== ReactPropTypesSecret && typeof console !== 'undefined') {
|
|
2836
|
+
var cacheKey = componentName + ':' + propName;
|
|
2837
|
+
if (!manualPropTypeCallCache[cacheKey]) {
|
|
2838
|
+
"development" !== 'production' ? warning(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will not work in production with the next major version. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', propFullName, componentName) : void 0;
|
|
2839
|
+
manualPropTypeCallCache[cacheKey] = true;
|
|
2840
|
+
}
|
|
2841
|
+
}
|
|
2842
|
+
}
|
|
2754
2843
|
if (props[propName] == null) {
|
|
2755
|
-
var locationName = ReactPropTypeLocationNames[location];
|
|
2756
2844
|
if (isRequired) {
|
|
2757
2845
|
if (props[propName] === null) {
|
|
2758
|
-
return new PropTypeError('The ' +
|
|
2846
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
|
2759
2847
|
}
|
|
2760
|
-
return new PropTypeError('The ' +
|
|
2848
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
|
2761
2849
|
}
|
|
2762
2850
|
return null;
|
|
2763
2851
|
} else {
|
|
@@ -2772,17 +2860,16 @@ function createChainableTypeChecker(validate) {
|
|
|
2772
2860
|
}
|
|
2773
2861
|
|
|
2774
2862
|
function createPrimitiveTypeChecker(expectedType) {
|
|
2775
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
2863
|
+
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
2776
2864
|
var propValue = props[propName];
|
|
2777
2865
|
var propType = getPropType(propValue);
|
|
2778
2866
|
if (propType !== expectedType) {
|
|
2779
|
-
var locationName = ReactPropTypeLocationNames[location];
|
|
2780
2867
|
// `propValue` being instance of, say, date/regexp, pass the 'object'
|
|
2781
2868
|
// check, but we can offer a more precise error message here rather than
|
|
2782
2869
|
// 'of type `object`'.
|
|
2783
2870
|
var preciseType = getPreciseType(propValue);
|
|
2784
2871
|
|
|
2785
|
-
return new PropTypeError('Invalid ' +
|
|
2872
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
|
|
2786
2873
|
}
|
|
2787
2874
|
return null;
|
|
2788
2875
|
}
|
|
@@ -2800,12 +2887,11 @@ function createArrayOfTypeChecker(typeChecker) {
|
|
|
2800
2887
|
}
|
|
2801
2888
|
var propValue = props[propName];
|
|
2802
2889
|
if (!Array.isArray(propValue)) {
|
|
2803
|
-
var locationName = ReactPropTypeLocationNames[location];
|
|
2804
2890
|
var propType = getPropType(propValue);
|
|
2805
|
-
return new PropTypeError('Invalid ' +
|
|
2891
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
|
2806
2892
|
}
|
|
2807
2893
|
for (var i = 0; i < propValue.length; i++) {
|
|
2808
|
-
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']');
|
|
2894
|
+
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
|
|
2809
2895
|
if (error instanceof Error) {
|
|
2810
2896
|
return error;
|
|
2811
2897
|
}
|
|
@@ -2819,9 +2905,8 @@ function createElementTypeChecker() {
|
|
|
2819
2905
|
function validate(props, propName, componentName, location, propFullName) {
|
|
2820
2906
|
var propValue = props[propName];
|
|
2821
2907
|
if (!ReactElement.isValidElement(propValue)) {
|
|
2822
|
-
var locationName = ReactPropTypeLocationNames[location];
|
|
2823
2908
|
var propType = getPropType(propValue);
|
|
2824
|
-
return new PropTypeError('Invalid ' +
|
|
2909
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
|
|
2825
2910
|
}
|
|
2826
2911
|
return null;
|
|
2827
2912
|
}
|
|
@@ -2831,10 +2916,9 @@ function createElementTypeChecker() {
|
|
|
2831
2916
|
function createInstanceTypeChecker(expectedClass) {
|
|
2832
2917
|
function validate(props, propName, componentName, location, propFullName) {
|
|
2833
2918
|
if (!(props[propName] instanceof expectedClass)) {
|
|
2834
|
-
var locationName = ReactPropTypeLocationNames[location];
|
|
2835
2919
|
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
2836
2920
|
var actualClassName = getClassName(props[propName]);
|
|
2837
|
-
return new PropTypeError('Invalid ' +
|
|
2921
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
|
2838
2922
|
}
|
|
2839
2923
|
return null;
|
|
2840
2924
|
}
|
|
@@ -2855,9 +2939,8 @@ function createEnumTypeChecker(expectedValues) {
|
|
|
2855
2939
|
}
|
|
2856
2940
|
}
|
|
2857
2941
|
|
|
2858
|
-
var locationName = ReactPropTypeLocationNames[location];
|
|
2859
2942
|
var valuesString = JSON.stringify(expectedValues);
|
|
2860
|
-
return new PropTypeError('Invalid ' +
|
|
2943
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
|
2861
2944
|
}
|
|
2862
2945
|
return createChainableTypeChecker(validate);
|
|
2863
2946
|
}
|
|
@@ -2870,12 +2953,11 @@ function createObjectOfTypeChecker(typeChecker) {
|
|
|
2870
2953
|
var propValue = props[propName];
|
|
2871
2954
|
var propType = getPropType(propValue);
|
|
2872
2955
|
if (propType !== 'object') {
|
|
2873
|
-
|
|
2874
|
-
return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
|
2956
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
|
2875
2957
|
}
|
|
2876
2958
|
for (var key in propValue) {
|
|
2877
2959
|
if (propValue.hasOwnProperty(key)) {
|
|
2878
|
-
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key);
|
|
2960
|
+
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
2879
2961
|
if (error instanceof Error) {
|
|
2880
2962
|
return error;
|
|
2881
2963
|
}
|
|
@@ -2895,13 +2977,12 @@ function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
|
2895
2977
|
function validate(props, propName, componentName, location, propFullName) {
|
|
2896
2978
|
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
2897
2979
|
var checker = arrayOfTypeCheckers[i];
|
|
2898
|
-
if (checker(props, propName, componentName, location, propFullName) == null) {
|
|
2980
|
+
if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
|
|
2899
2981
|
return null;
|
|
2900
2982
|
}
|
|
2901
2983
|
}
|
|
2902
2984
|
|
|
2903
|
-
|
|
2904
|
-
return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
|
|
2985
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
|
|
2905
2986
|
}
|
|
2906
2987
|
return createChainableTypeChecker(validate);
|
|
2907
2988
|
}
|
|
@@ -2909,8 +2990,7 @@ function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
|
2909
2990
|
function createNodeChecker() {
|
|
2910
2991
|
function validate(props, propName, componentName, location, propFullName) {
|
|
2911
2992
|
if (!isNode(props[propName])) {
|
|
2912
|
-
|
|
2913
|
-
return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
|
2993
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
|
2914
2994
|
}
|
|
2915
2995
|
return null;
|
|
2916
2996
|
}
|
|
@@ -2922,15 +3002,14 @@ function createShapeTypeChecker(shapeTypes) {
|
|
|
2922
3002
|
var propValue = props[propName];
|
|
2923
3003
|
var propType = getPropType(propValue);
|
|
2924
3004
|
if (propType !== 'object') {
|
|
2925
|
-
|
|
2926
|
-
return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
3005
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
2927
3006
|
}
|
|
2928
3007
|
for (var key in shapeTypes) {
|
|
2929
3008
|
var checker = shapeTypes[key];
|
|
2930
3009
|
if (!checker) {
|
|
2931
3010
|
continue;
|
|
2932
3011
|
}
|
|
2933
|
-
var error = checker(propValue, key, componentName, location, propFullName + '.' + key);
|
|
3012
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
2934
3013
|
if (error) {
|
|
2935
3014
|
return error;
|
|
2936
3015
|
}
|
|
@@ -3047,7 +3126,7 @@ function getClassName(propValue) {
|
|
|
3047
3126
|
}
|
|
3048
3127
|
|
|
3049
3128
|
module.exports = ReactPropTypes;
|
|
3050
|
-
},{"
|
|
3129
|
+
},{"11":11,"17":17,"25":25,"27":27,"29":29,"31":31,"32":32}],17:[function(_dereq_,module,exports){
|
|
3051
3130
|
/**
|
|
3052
3131
|
* Copyright 2013-present, Facebook, Inc.
|
|
3053
3132
|
* All rights reserved.
|
|
@@ -3056,40 +3135,15 @@ module.exports = ReactPropTypes;
|
|
|
3056
3135
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
3057
3136
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
3058
3137
|
*
|
|
3138
|
+
*
|
|
3059
3139
|
*/
|
|
3060
3140
|
|
|
3061
3141
|
'use strict';
|
|
3062
3142
|
|
|
3063
|
-
var
|
|
3143
|
+
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
3064
3144
|
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
var emptyObject = _dereq_(28);
|
|
3069
|
-
|
|
3070
|
-
/**
|
|
3071
|
-
* Base class helpers for the updating state of a component.
|
|
3072
|
-
*/
|
|
3073
|
-
function ReactPureComponent(props, context, updater) {
|
|
3074
|
-
// Duplicated from ReactComponent.
|
|
3075
|
-
this.props = props;
|
|
3076
|
-
this.context = context;
|
|
3077
|
-
this.refs = emptyObject;
|
|
3078
|
-
// We initialize the default updater but the real one gets injected by the
|
|
3079
|
-
// renderer.
|
|
3080
|
-
this.updater = updater || ReactNoopUpdateQueue;
|
|
3081
|
-
}
|
|
3082
|
-
|
|
3083
|
-
function ComponentDummy() {}
|
|
3084
|
-
ComponentDummy.prototype = ReactComponent.prototype;
|
|
3085
|
-
ReactPureComponent.prototype = new ComponentDummy();
|
|
3086
|
-
ReactPureComponent.prototype.constructor = ReactPureComponent;
|
|
3087
|
-
// Avoid an extra prototype jump for these methods.
|
|
3088
|
-
_assign(ReactPureComponent.prototype, ReactComponent.prototype);
|
|
3089
|
-
ReactPureComponent.prototype.isPureReactComponent = true;
|
|
3090
|
-
|
|
3091
|
-
module.exports = ReactPureComponent;
|
|
3092
|
-
},{"13":13,"28":28,"31":31,"6":6}],17:[function(_dereq_,module,exports){
|
|
3145
|
+
module.exports = ReactPropTypesSecret;
|
|
3146
|
+
},{}],18:[function(_dereq_,module,exports){
|
|
3093
3147
|
/**
|
|
3094
3148
|
* Copyright 2013-present, Facebook, Inc.
|
|
3095
3149
|
* All rights reserved.
|
|
@@ -3116,7 +3170,7 @@ module.exports = {
|
|
|
3116
3170
|
YieldComponent: 9,
|
|
3117
3171
|
Fragment: 10
|
|
3118
3172
|
};
|
|
3119
|
-
},{}],
|
|
3173
|
+
},{}],19:[function(_dereq_,module,exports){
|
|
3120
3174
|
/**
|
|
3121
3175
|
* Copyright 2013-present, Facebook, Inc.
|
|
3122
3176
|
* All rights reserved.
|
|
@@ -3129,7 +3183,7 @@ module.exports = {
|
|
|
3129
3183
|
|
|
3130
3184
|
'use strict';
|
|
3131
3185
|
|
|
3132
|
-
var _assign = _dereq_(
|
|
3186
|
+
var _assign = _dereq_(33);
|
|
3133
3187
|
|
|
3134
3188
|
var React = _dereq_(3);
|
|
3135
3189
|
|
|
@@ -3148,7 +3202,7 @@ if ("development" !== 'production') {
|
|
|
3148
3202
|
}
|
|
3149
3203
|
|
|
3150
3204
|
module.exports = ReactUMDEntry;
|
|
3151
|
-
},{"3":3,"
|
|
3205
|
+
},{"3":3,"33":33,"7":7,"8":8}],20:[function(_dereq_,module,exports){
|
|
3152
3206
|
/**
|
|
3153
3207
|
* Copyright 2013-present, Facebook, Inc.
|
|
3154
3208
|
* All rights reserved.
|
|
@@ -3161,8 +3215,8 @@ module.exports = ReactUMDEntry;
|
|
|
3161
3215
|
|
|
3162
3216
|
'use strict';
|
|
3163
3217
|
|
|
3164
|
-
module.exports = '16.0.0-alpha.
|
|
3165
|
-
},{}],
|
|
3218
|
+
module.exports = '16.0.0-alpha.5';
|
|
3219
|
+
},{}],21:[function(_dereq_,module,exports){
|
|
3166
3220
|
/**
|
|
3167
3221
|
* Copyright 2013-present, Facebook, Inc.
|
|
3168
3222
|
* All rights reserved.
|
|
@@ -3188,8 +3242,7 @@ if ("development" !== 'production') {
|
|
|
3188
3242
|
}
|
|
3189
3243
|
|
|
3190
3244
|
module.exports = canDefineProperty;
|
|
3191
|
-
},{}],
|
|
3192
|
-
(function (process){
|
|
3245
|
+
},{}],22:[function(_dereq_,module,exports){
|
|
3193
3246
|
/**
|
|
3194
3247
|
* Copyright 2013-present, Facebook, Inc.
|
|
3195
3248
|
* All rights reserved.
|
|
@@ -3202,23 +3255,12 @@ module.exports = canDefineProperty;
|
|
|
3202
3255
|
|
|
3203
3256
|
'use strict';
|
|
3204
3257
|
|
|
3205
|
-
var _prodInvariant = _dereq_(
|
|
3258
|
+
var _prodInvariant = _dereq_(27);
|
|
3206
3259
|
|
|
3207
|
-
var
|
|
3260
|
+
var ReactPropTypesSecret = _dereq_(17);
|
|
3208
3261
|
|
|
3209
|
-
var invariant = _dereq_(
|
|
3210
|
-
var warning = _dereq_(
|
|
3211
|
-
|
|
3212
|
-
var ReactComponentTreeHook;
|
|
3213
|
-
|
|
3214
|
-
if (typeof process !== 'undefined' && process.env && "development" === 'test') {
|
|
3215
|
-
// Temporary hack.
|
|
3216
|
-
// Inline requires don't work well with Jest:
|
|
3217
|
-
// https://github.com/facebook/react/issues/7240
|
|
3218
|
-
// Remove the inline requires when we don't need them anymore:
|
|
3219
|
-
// https://github.com/facebook/react/pull/7178
|
|
3220
|
-
ReactComponentTreeHook = _dereq_(7);
|
|
3221
|
-
}
|
|
3262
|
+
var invariant = _dereq_(31);
|
|
3263
|
+
var warning = _dereq_(32);
|
|
3222
3264
|
|
|
3223
3265
|
var loggedTypeFailures = {};
|
|
3224
3266
|
|
|
@@ -3230,65 +3272,65 @@ var loggedTypeFailures = {};
|
|
|
3230
3272
|
* @param {object} values Runtime values that need to be type-checked
|
|
3231
3273
|
* @param {string} location e.g. "prop", "context", "child context"
|
|
3232
3274
|
* @param {string} componentName Name of the component for error messages.
|
|
3233
|
-
* @param {?
|
|
3234
|
-
* @param {?number} workInProgressOrDebugID The React component instance that is being type-checked
|
|
3275
|
+
* @param {?Function} getStack Returns the component stack.
|
|
3235
3276
|
* @private
|
|
3236
3277
|
*/
|
|
3237
|
-
function
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
loggedTypeFailures[error.message] = true;
|
|
3278
|
+
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
3279
|
+
if ("development" !== 'production') {
|
|
3280
|
+
for (var typeSpecName in typeSpecs) {
|
|
3281
|
+
if (typeSpecs.hasOwnProperty(typeSpecName)) {
|
|
3282
|
+
var error;
|
|
3283
|
+
// Prop type validation may throw. In case they do, we don't want to
|
|
3284
|
+
// fail the render phase where it didn't fail before. So we log it.
|
|
3285
|
+
// After these have been cleaned up, we'll let them throw.
|
|
3286
|
+
try {
|
|
3287
|
+
// This is intentionally an invariant that gets caught. It's the same
|
|
3288
|
+
// behavior as without this statement except with a better message.
|
|
3289
|
+
!(typeof typeSpecs[typeSpecName] === 'function') ? "development" !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.', componentName || 'React class', location, typeSpecName) : _prodInvariant('84', componentName || 'React class', location, typeSpecName) : void 0;
|
|
3290
|
+
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
|
3291
|
+
} catch (ex) {
|
|
3292
|
+
error = ex;
|
|
3293
|
+
}
|
|
3294
|
+
"development" !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error) : void 0;
|
|
3295
|
+
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
3296
|
+
// Only monitor this failure once because there tends to be a lot of the
|
|
3297
|
+
// same error.
|
|
3298
|
+
loggedTypeFailures[error.message] = true;
|
|
3259
3299
|
|
|
3260
|
-
|
|
3300
|
+
var stack = getStack ? getStack() : '';
|
|
3261
3301
|
|
|
3262
|
-
|
|
3263
|
-
if (!ReactComponentTreeHook) {
|
|
3264
|
-
ReactComponentTreeHook = _dereq_(7);
|
|
3265
|
-
}
|
|
3266
|
-
if (workInProgressOrDebugID != null) {
|
|
3267
|
-
if (typeof workInProgressOrDebugID === 'number') {
|
|
3268
|
-
// DebugID from Stack.
|
|
3269
|
-
var debugID = workInProgressOrDebugID;
|
|
3270
|
-
componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID);
|
|
3271
|
-
} else if (typeof workInProgressOrDebugID.tag === 'number') {
|
|
3272
|
-
// This is a Fiber.
|
|
3273
|
-
// The stack will only be correct if this is a work in progress
|
|
3274
|
-
// version and we're calling it during reconciliation.
|
|
3275
|
-
var workInProgress = workInProgressOrDebugID;
|
|
3276
|
-
componentStackInfo = ReactComponentTreeHook.getStackAddendumByWorkInProgressFiber(workInProgress);
|
|
3277
|
-
}
|
|
3278
|
-
} else if (element !== null) {
|
|
3279
|
-
componentStackInfo = ReactComponentTreeHook.getCurrentStackAddendum(element);
|
|
3280
|
-
}
|
|
3302
|
+
"development" !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '') : void 0;
|
|
3281
3303
|
}
|
|
3282
|
-
|
|
3283
|
-
"development" !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, componentStackInfo) : void 0;
|
|
3284
3304
|
}
|
|
3285
3305
|
}
|
|
3286
3306
|
}
|
|
3287
3307
|
}
|
|
3288
3308
|
|
|
3309
|
+
module.exports = checkPropTypes;
|
|
3310
|
+
},{"17":17,"27":27,"31":31,"32":32}],23:[function(_dereq_,module,exports){
|
|
3311
|
+
/**
|
|
3312
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3313
|
+
* All rights reserved.
|
|
3314
|
+
*
|
|
3315
|
+
* This source code is licensed under the BSD-style license found in the
|
|
3316
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
3317
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
3318
|
+
*
|
|
3319
|
+
*/
|
|
3320
|
+
|
|
3321
|
+
'use strict';
|
|
3322
|
+
|
|
3323
|
+
var checkPropTypes = _dereq_(22);
|
|
3324
|
+
|
|
3325
|
+
var _require = _dereq_(10),
|
|
3326
|
+
getStackAddendum = _require.getStackAddendum;
|
|
3327
|
+
|
|
3328
|
+
function checkReactTypeSpec(typeSpecs, values, location, componentName) {
|
|
3329
|
+
checkPropTypes(typeSpecs, values, location, componentName, getStackAddendum);
|
|
3330
|
+
}
|
|
3331
|
+
|
|
3289
3332
|
module.exports = checkReactTypeSpec;
|
|
3290
|
-
}
|
|
3291
|
-
},{"14":14,"25":25,"29":29,"30":30,"7":7}],22:[function(_dereq_,module,exports){
|
|
3333
|
+
},{"10":10,"22":22}],24:[function(_dereq_,module,exports){
|
|
3292
3334
|
/**
|
|
3293
3335
|
* Copyright 2013-present, Facebook, Inc.
|
|
3294
3336
|
* All rights reserved.
|
|
@@ -3324,7 +3366,7 @@ function getComponentName(instanceOrFiber) {
|
|
|
3324
3366
|
}
|
|
3325
3367
|
|
|
3326
3368
|
module.exports = getComponentName;
|
|
3327
|
-
},{}],
|
|
3369
|
+
},{}],25:[function(_dereq_,module,exports){
|
|
3328
3370
|
/**
|
|
3329
3371
|
* Copyright 2013-present, Facebook, Inc.
|
|
3330
3372
|
* All rights reserved.
|
|
@@ -3365,7 +3407,7 @@ function getIteratorFn(maybeIterable) {
|
|
|
3365
3407
|
}
|
|
3366
3408
|
|
|
3367
3409
|
module.exports = getIteratorFn;
|
|
3368
|
-
},{}],
|
|
3410
|
+
},{}],26:[function(_dereq_,module,exports){
|
|
3369
3411
|
/**
|
|
3370
3412
|
* Copyright 2013-present, Facebook, Inc.
|
|
3371
3413
|
* All rights reserved.
|
|
@@ -3377,11 +3419,11 @@ module.exports = getIteratorFn;
|
|
|
3377
3419
|
*/
|
|
3378
3420
|
'use strict';
|
|
3379
3421
|
|
|
3380
|
-
var _prodInvariant = _dereq_(
|
|
3422
|
+
var _prodInvariant = _dereq_(27);
|
|
3381
3423
|
|
|
3382
|
-
var ReactElement = _dereq_(
|
|
3424
|
+
var ReactElement = _dereq_(11);
|
|
3383
3425
|
|
|
3384
|
-
var invariant = _dereq_(
|
|
3426
|
+
var invariant = _dereq_(31);
|
|
3385
3427
|
|
|
3386
3428
|
/**
|
|
3387
3429
|
* Returns the first child in a collection of children and verifies that there
|
|
@@ -3403,7 +3445,7 @@ function onlyChild(children) {
|
|
|
3403
3445
|
}
|
|
3404
3446
|
|
|
3405
3447
|
module.exports = onlyChild;
|
|
3406
|
-
},{"
|
|
3448
|
+
},{"11":11,"27":27,"31":31}],27:[function(_dereq_,module,exports){
|
|
3407
3449
|
/**
|
|
3408
3450
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
3409
3451
|
* All rights reserved.
|
|
@@ -3442,7 +3484,7 @@ function reactProdInvariant(code) {
|
|
|
3442
3484
|
}
|
|
3443
3485
|
|
|
3444
3486
|
module.exports = reactProdInvariant;
|
|
3445
|
-
},{}],
|
|
3487
|
+
},{}],28:[function(_dereq_,module,exports){
|
|
3446
3488
|
/**
|
|
3447
3489
|
* Copyright 2013-present, Facebook, Inc.
|
|
3448
3490
|
* All rights reserved.
|
|
@@ -3455,15 +3497,15 @@ module.exports = reactProdInvariant;
|
|
|
3455
3497
|
|
|
3456
3498
|
'use strict';
|
|
3457
3499
|
|
|
3458
|
-
var _prodInvariant = _dereq_(
|
|
3500
|
+
var _prodInvariant = _dereq_(27);
|
|
3459
3501
|
|
|
3460
3502
|
var ReactCurrentOwner = _dereq_(8);
|
|
3461
|
-
var REACT_ELEMENT_TYPE = _dereq_(
|
|
3503
|
+
var REACT_ELEMENT_TYPE = _dereq_(12);
|
|
3462
3504
|
|
|
3463
|
-
var getIteratorFn = _dereq_(
|
|
3464
|
-
var invariant = _dereq_(
|
|
3505
|
+
var getIteratorFn = _dereq_(25);
|
|
3506
|
+
var invariant = _dereq_(31);
|
|
3465
3507
|
var KeyEscapeUtils = _dereq_(1);
|
|
3466
|
-
var warning = _dereq_(
|
|
3508
|
+
var warning = _dereq_(32);
|
|
3467
3509
|
|
|
3468
3510
|
var SEPARATOR = '.';
|
|
3469
3511
|
var SUBSEPARATOR = ':';
|
|
@@ -3540,52 +3582,41 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
|
|
|
3540
3582
|
} else {
|
|
3541
3583
|
var iteratorFn = getIteratorFn(children);
|
|
3542
3584
|
if (iteratorFn) {
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
var ii = 0;
|
|
3547
|
-
while (!(step = iterator.next()).done) {
|
|
3548
|
-
child = step.value;
|
|
3549
|
-
nextName = nextNamePrefix + getComponentKey(child, ii++);
|
|
3550
|
-
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
|
3551
|
-
}
|
|
3552
|
-
} else {
|
|
3553
|
-
if ("development" !== 'production') {
|
|
3585
|
+
if ("development" !== 'production') {
|
|
3586
|
+
// Warn about using Maps as children
|
|
3587
|
+
if (iteratorFn === children.entries) {
|
|
3554
3588
|
var mapsAsChildrenAddendum = '';
|
|
3555
3589
|
if (ReactCurrentOwner.current) {
|
|
3556
3590
|
var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName();
|
|
3557
3591
|
if (mapsAsChildrenOwnerName) {
|
|
3558
|
-
mapsAsChildrenAddendum = '
|
|
3592
|
+
mapsAsChildrenAddendum = '\n\nCheck the render method of `' + mapsAsChildrenOwnerName + '`.';
|
|
3559
3593
|
}
|
|
3560
3594
|
}
|
|
3561
|
-
"development" !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is
|
|
3595
|
+
"development" !== 'production' ? 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', mapsAsChildrenAddendum) : void 0;
|
|
3562
3596
|
didWarnAboutMaps = true;
|
|
3563
3597
|
}
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3598
|
+
}
|
|
3599
|
+
|
|
3600
|
+
var iterator = iteratorFn.call(children);
|
|
3601
|
+
var step;
|
|
3602
|
+
var ii = 0;
|
|
3603
|
+
while (!(step = iterator.next()).done) {
|
|
3604
|
+
child = step.value;
|
|
3605
|
+
nextName = nextNamePrefix + getComponentKey(child, ii++);
|
|
3606
|
+
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
|
3573
3607
|
}
|
|
3574
3608
|
} else if (type === 'object') {
|
|
3575
3609
|
var addendum = '';
|
|
3576
3610
|
if ("development" !== 'production') {
|
|
3577
|
-
addendum = ' If you meant to render a collection of children, use an array ' + 'instead
|
|
3578
|
-
if (children._isReactElement) {
|
|
3579
|
-
addendum = ' It looks like you\'re using an element created by a different ' + 'version of React. Make sure to use only one copy of React.';
|
|
3580
|
-
}
|
|
3611
|
+
addendum = ' If you meant to render a collection of children, use an array ' + 'instead.';
|
|
3581
3612
|
if (ReactCurrentOwner.current) {
|
|
3582
3613
|
var name = ReactCurrentOwner.current.getName();
|
|
3583
3614
|
if (name) {
|
|
3584
|
-
addendum += '
|
|
3615
|
+
addendum += '\n\nCheck the render method of `' + name + '`.';
|
|
3585
3616
|
}
|
|
3586
3617
|
}
|
|
3587
3618
|
}
|
|
3588
|
-
var childrenString =
|
|
3619
|
+
var childrenString = '' + children;
|
|
3589
3620
|
!false ? "development" !== 'production' ? 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) : _prodInvariant('31', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : void 0;
|
|
3590
3621
|
}
|
|
3591
3622
|
}
|
|
@@ -3618,7 +3649,7 @@ function traverseAllChildren(children, callback, traverseContext) {
|
|
|
3618
3649
|
}
|
|
3619
3650
|
|
|
3620
3651
|
module.exports = traverseAllChildren;
|
|
3621
|
-
},{"1":1,"
|
|
3652
|
+
},{"1":1,"12":12,"25":25,"27":27,"31":31,"32":32,"8":8}],29:[function(_dereq_,module,exports){
|
|
3622
3653
|
"use strict";
|
|
3623
3654
|
|
|
3624
3655
|
/**
|
|
@@ -3657,7 +3688,7 @@ emptyFunction.thatReturnsArgument = function (arg) {
|
|
|
3657
3688
|
};
|
|
3658
3689
|
|
|
3659
3690
|
module.exports = emptyFunction;
|
|
3660
|
-
},{}],
|
|
3691
|
+
},{}],30:[function(_dereq_,module,exports){
|
|
3661
3692
|
/**
|
|
3662
3693
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
3663
3694
|
* All rights reserved.
|
|
@@ -3677,7 +3708,7 @@ if ("development" !== 'production') {
|
|
|
3677
3708
|
}
|
|
3678
3709
|
|
|
3679
3710
|
module.exports = emptyObject;
|
|
3680
|
-
},{}],
|
|
3711
|
+
},{}],31:[function(_dereq_,module,exports){
|
|
3681
3712
|
/**
|
|
3682
3713
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
3683
3714
|
* All rights reserved.
|
|
@@ -3727,7 +3758,7 @@ function invariant(condition, format, a, b, c, d, e, f) {
|
|
|
3727
3758
|
}
|
|
3728
3759
|
|
|
3729
3760
|
module.exports = invariant;
|
|
3730
|
-
},{}],
|
|
3761
|
+
},{}],32:[function(_dereq_,module,exports){
|
|
3731
3762
|
/**
|
|
3732
3763
|
* Copyright 2014-2015, Facebook, Inc.
|
|
3733
3764
|
* All rights reserved.
|
|
@@ -3740,7 +3771,7 @@ module.exports = invariant;
|
|
|
3740
3771
|
|
|
3741
3772
|
'use strict';
|
|
3742
3773
|
|
|
3743
|
-
var emptyFunction = _dereq_(
|
|
3774
|
+
var emptyFunction = _dereq_(29);
|
|
3744
3775
|
|
|
3745
3776
|
/**
|
|
3746
3777
|
* Similar to invariant but only logs a warning if the condition is not met.
|
|
@@ -3794,9 +3825,16 @@ if ("development" !== 'production') {
|
|
|
3794
3825
|
}
|
|
3795
3826
|
|
|
3796
3827
|
module.exports = warning;
|
|
3797
|
-
},{"
|
|
3828
|
+
},{"29":29}],33:[function(_dereq_,module,exports){
|
|
3829
|
+
/*
|
|
3830
|
+
object-assign
|
|
3831
|
+
(c) Sindre Sorhus
|
|
3832
|
+
@license MIT
|
|
3833
|
+
*/
|
|
3834
|
+
|
|
3798
3835
|
'use strict';
|
|
3799
3836
|
/* eslint-disable no-unused-vars */
|
|
3837
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
3800
3838
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
3801
3839
|
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
3802
3840
|
|
|
@@ -3817,7 +3855,7 @@ function shouldUseNative() {
|
|
|
3817
3855
|
// Detect buggy property enumeration order in older V8 versions.
|
|
3818
3856
|
|
|
3819
3857
|
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
|
3820
|
-
var test1 = new String('abc'); // eslint-disable-line
|
|
3858
|
+
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
|
3821
3859
|
test1[5] = 'de';
|
|
3822
3860
|
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
|
3823
3861
|
return false;
|
|
@@ -3846,7 +3884,7 @@ function shouldUseNative() {
|
|
|
3846
3884
|
}
|
|
3847
3885
|
|
|
3848
3886
|
return true;
|
|
3849
|
-
} catch (
|
|
3887
|
+
} catch (err) {
|
|
3850
3888
|
// We don't expect any of the above to throw, but better to be safe.
|
|
3851
3889
|
return false;
|
|
3852
3890
|
}
|
|
@@ -3866,8 +3904,8 @@ module.exports = shouldUseNative() ? Object.assign : function (target, source) {
|
|
|
3866
3904
|
}
|
|
3867
3905
|
}
|
|
3868
3906
|
|
|
3869
|
-
if (
|
|
3870
|
-
symbols =
|
|
3907
|
+
if (getOwnPropertySymbols) {
|
|
3908
|
+
symbols = getOwnPropertySymbols(from);
|
|
3871
3909
|
for (var i = 0; i < symbols.length; i++) {
|
|
3872
3910
|
if (propIsEnumerable.call(from, symbols[i])) {
|
|
3873
3911
|
to[symbols[i]] = from[symbols[i]];
|
|
@@ -3879,5 +3917,5 @@ module.exports = shouldUseNative() ? Object.assign : function (target, source) {
|
|
|
3879
3917
|
return to;
|
|
3880
3918
|
};
|
|
3881
3919
|
|
|
3882
|
-
},{}]},{},[
|
|
3920
|
+
},{}]},{},[19])(19)
|
|
3883
3921
|
});
|