react 16.0.0-rc.3 → 16.1.0-rc
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 +16 -26
- package/README.md +1 -1
- package/cjs/react.development.js +299 -676
- package/cjs/react.production.min.js +22 -25
- package/package.json +6 -7
- package/umd/react.development.js +418 -771
- package/umd/react.production.min.js +21 -24
- package/PATENTS +0 -33
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
Object.keys(a).join(", ")+"}":d,""));return g}function O(a,b){return"object"===typeof a&&null!==a&&null!=a.key?escape(a.key):b.toString(36)}function P(a,b){a.func.call(a.context,b,a.count++)}function Q(a,b,d){var e=a.result,c=a.keyPrefix;a=a.func.call(a.context,b,a.count++);Array.isArray(a)?R(a,e,d,r.thatReturnsArgument):null!=a&&(G.isValidElement(a)&&(a=G.cloneAndReplaceKey(a,c+(!a.key||b&&b.key===a.key?"":(""+a.key).replace(J,"$\x26/")+"/")+d)),e.push(a))}
|
|
24
|
-
function R(a,b,d,e,c){var g="";null!=d&&(g=(""+d).replace(J,"$\x26/")+"/");b=L(b,g,e,c);null==a||N(a,"",Q,b);M(b)}var S={forEach:function(a,b,d){if(null==a)return a;b=L(null,null,b,d);null==a||N(a,"",P,b);M(b)},map:function(a,b,d){if(null==a)return a;var e=[];R(a,e,null,b,d);return e},count:function(a){return null==a?0:N(a,"",r.thatReturnsNull,null)},toArray:function(a){var b=[];R(a,b,null,r.thatReturnsArgument);return b}};
|
|
25
|
-
module.exports={Children:{map:S.map,forEach:S.forEach,count:S.count,toArray:S.toArray,only:function(a){G.isValidElement(a)?void 0:t("143");return a}},Component:B.Component,PureComponent:B.PureComponent,unstable_AsyncComponent:B.AsyncComponent,createElement:G.createElement,cloneElement:G.cloneElement,isValidElement:G.isValidElement,createFactory:G.createFactory,version:"16.0.0-rc.3",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:C,assign:f}};
|
|
1
|
+
/** @license React v16.1.0-rc
|
|
2
|
+
* react.production.min.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
|
+
*/
|
|
9
|
+
'use strict';var m=require("object-assign"),n=require("fbjs/lib/emptyObject"),p=require("fbjs/lib/emptyFunction");
|
|
10
|
+
function q(a){for(var b=arguments.length-1,e="Minified React error #"+a+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant\x3d"+a,d=0;d<b;d++)e+="\x26args[]\x3d"+encodeURIComponent(arguments[d+1]);b=Error(e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.");b.name="Invariant Violation";b.framesToPop=1;throw b;}
|
|
11
|
+
var r={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}};function t(a,b,e){this.props=a;this.context=b;this.refs=n;this.updater=e||r}t.prototype.isReactComponent={};t.prototype.setState=function(a,b){"object"!==typeof a&&"function"!==typeof a&&null!=a?q("85"):void 0;this.updater.enqueueSetState(this,a,b,"setState")};t.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};
|
|
12
|
+
function u(a,b,e){this.props=a;this.context=b;this.refs=n;this.updater=e||r}function v(){}v.prototype=t.prototype;var w=u.prototype=new v;w.constructor=u;m(w,t.prototype);w.isPureReactComponent=!0;function x(a,b,e){this.props=a;this.context=b;this.refs=n;this.updater=e||r}var y=x.prototype=new v;y.constructor=x;m(y,t.prototype);y.unstable_isAsyncReactComponent=!0;y.render=function(){return this.props.children};
|
|
13
|
+
var z={current:null},A=Object.prototype.hasOwnProperty,B="function"===typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103,C={key:!0,ref:!0,__self:!0,__source:!0};
|
|
14
|
+
function D(a,b,e){var d,c={},h=null,k=null;if(null!=b)for(d in void 0!==b.ref&&(k=b.ref),void 0!==b.key&&(h=""+b.key),b)A.call(b,d)&&!C.hasOwnProperty(d)&&(c[d]=b[d]);var f=arguments.length-2;if(1===f)c.children=e;else if(1<f){for(var g=Array(f),l=0;l<f;l++)g[l]=arguments[l+2];c.children=g}if(a&&a.defaultProps)for(d in f=a.defaultProps,f)void 0===c[d]&&(c[d]=f[d]);return{$$typeof:B,type:a,key:h,ref:k,props:c,_owner:z.current}}function E(a){return"object"===typeof a&&null!==a&&a.$$typeof===B}
|
|
15
|
+
var F="function"===typeof Symbol&&Symbol.iterator,G="function"===typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103,H="function"===typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.portal")||60106;function escape(a){var b={"\x3d":"\x3d0",":":"\x3d2"};return"$"+(""+a).replace(/[=:]/g,function(a){return b[a]})}var I=/\/+/g,J=[];
|
|
16
|
+
function K(a,b,e,d){if(J.length){var c=J.pop();c.result=a;c.keyPrefix=b;c.func=e;c.context=d;c.count=0;return c}return{result:a,keyPrefix:b,func:e,context:d,count:0}}function L(a){a.result=null;a.keyPrefix=null;a.func=null;a.context=null;a.count=0;10>J.length&&J.push(a)}
|
|
17
|
+
function M(a,b,e,d){var c=typeof a;if("undefined"===c||"boolean"===c)a=null;if(null===a||"string"===c||"number"===c||"object"===c&&a.$$typeof===G||"object"===c&&a.$$typeof===H)return e(d,a,""===b?"."+N(a,0):b),1;var h=0;b=""===b?".":b+":";if(Array.isArray(a))for(var k=0;k<a.length;k++){c=a[k];var f=b+N(c,k);h+=M(c,f,e,d)}else if(f=F&&a[F]||a["@@iterator"],"function"===typeof f)for(a=f.call(a),k=0;!(c=a.next()).done;)c=c.value,f=b+N(c,k++),h+=M(c,f,e,d);else"object"===c&&(e=""+a,q("31","[object Object]"===
|
|
18
|
+
e?"object with keys {"+Object.keys(a).join(", ")+"}":e,""));return h}function N(a,b){return"object"===typeof a&&null!==a&&null!=a.key?escape(a.key):b.toString(36)}function O(a,b){a.func.call(a.context,b,a.count++)}
|
|
19
|
+
function P(a,b,e){var d=a.result,c=a.keyPrefix;a=a.func.call(a.context,b,a.count++);Array.isArray(a)?Q(a,d,e,p.thatReturnsArgument):null!=a&&(E(a)&&(b=c+(!a.key||b&&b.key===a.key?"":(""+a.key).replace(I,"$\x26/")+"/")+e,a={$$typeof:B,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}),d.push(a))}function Q(a,b,e,d,c){var h="";null!=e&&(h=(""+e).replace(I,"$\x26/")+"/");b=K(b,h,d,c);null==a||M(a,"",P,b);L(b)}"function"===typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.fragment");
|
|
20
|
+
var R={Children:{map:function(a,b,e){if(null==a)return a;var d=[];Q(a,d,null,b,e);return d},forEach:function(a,b,e){if(null==a)return a;b=K(null,null,b,e);null==a||M(a,"",O,b);L(b)},count:function(a){return null==a?0:M(a,"",p.thatReturnsNull,null)},toArray:function(a){var b=[];Q(a,b,null,p.thatReturnsArgument);return b},only:function(a){E(a)?void 0:q("143");return a}},Component:t,PureComponent:u,unstable_AsyncComponent:x,createElement:D,cloneElement:function(a,b,e){var d=m({},a.props),c=a.key,h=a.ref,
|
|
21
|
+
k=a._owner;if(null!=b){void 0!==b.ref&&(h=b.ref,k=z.current);void 0!==b.key&&(c=""+b.key);if(a.type&&a.type.defaultProps)var f=a.type.defaultProps;for(g in b)A.call(b,g)&&!C.hasOwnProperty(g)&&(d[g]=void 0===b[g]&&void 0!==f?f[g]:b[g])}var g=arguments.length-2;if(1===g)d.children=e;else if(1<g){f=Array(g);for(var l=0;l<g;l++)f[l]=arguments[l+2];d.children=f}return{$$typeof:B,type:a.type,key:c,ref:h,props:d,_owner:k}},createFactory:function(a){var b=D.bind(null,a);b.type=a;return b},isValidElement:E,
|
|
22
|
+
version:"16.1.0-rc",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:z,assign:m}},S=Object.freeze({default:R}),T=S&&R||S;module.exports=T["default"]?T["default"]:T;
|
package/package.json
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react",
|
|
3
3
|
"description": "React is a JavaScript library for building user interfaces.",
|
|
4
|
-
"version": "16.0.0-rc.3",
|
|
5
4
|
"keywords": [
|
|
6
5
|
"react"
|
|
7
6
|
],
|
|
8
|
-
"
|
|
7
|
+
"version": "16.1.0-rc",
|
|
8
|
+
"homepage": "https://reactjs.org/",
|
|
9
9
|
"bugs": "https://github.com/facebook/react/issues",
|
|
10
|
-
"license": "
|
|
10
|
+
"license": "MIT",
|
|
11
11
|
"files": [
|
|
12
12
|
"LICENSE",
|
|
13
|
-
"PATENTS",
|
|
14
13
|
"README.md",
|
|
15
14
|
"index.js",
|
|
16
15
|
"cjs/",
|
|
@@ -22,10 +21,10 @@
|
|
|
22
21
|
"node": ">=0.10.0"
|
|
23
22
|
},
|
|
24
23
|
"dependencies": {
|
|
25
|
-
"fbjs": "^0.8.
|
|
24
|
+
"fbjs": "^0.8.16",
|
|
26
25
|
"loose-envify": "^1.1.0",
|
|
27
|
-
"object-assign": "^4.1.
|
|
28
|
-
"prop-types": "^15.
|
|
26
|
+
"object-assign": "^4.1.1",
|
|
27
|
+
"prop-types": "^15.6.0"
|
|
29
28
|
},
|
|
30
29
|
"browserify": {
|
|
31
30
|
"transform": [
|
package/umd/react.development.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/** @license React v16.
|
|
1
|
+
/** @license React v16.1.0-rc
|
|
2
2
|
* react.development.js
|
|
3
3
|
*
|
|
4
|
-
* Copyright 2013-present, Facebook, Inc.
|
|
5
|
-
* All rights reserved.
|
|
4
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
6
5
|
*
|
|
7
|
-
* This source code is licensed under the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
8
|
*/
|
|
11
9
|
|
|
10
|
+
'use strict';
|
|
11
|
+
|
|
12
12
|
(function (global, factory) {
|
|
13
13
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
14
14
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
@@ -21,6 +21,7 @@ object-assign
|
|
|
21
21
|
@license MIT
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
+
|
|
24
25
|
/* eslint-disable no-unused-vars */
|
|
25
26
|
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
26
27
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
@@ -78,7 +79,7 @@ function shouldUseNative() {
|
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
81
|
|
|
81
|
-
var
|
|
82
|
+
var objectAssign$1 = shouldUseNative() ? Object.assign : function (target, source) {
|
|
82
83
|
var from;
|
|
83
84
|
var to = toObject(target);
|
|
84
85
|
var symbols;
|
|
@@ -105,25 +106,162 @@ var index = shouldUseNative() ? Object.assign : function (target, source) {
|
|
|
105
106
|
return to;
|
|
106
107
|
};
|
|
107
108
|
|
|
109
|
+
// TODO: this is special because it gets imported during build.
|
|
110
|
+
|
|
111
|
+
var ReactVersion = '16.1.0-rc';
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* WARNING: DO NOT manually require this module.
|
|
115
|
+
* This is a replacement for `invariant(...)` used by the error code system
|
|
116
|
+
* and will _only_ be required by the corresponding babel pass.
|
|
117
|
+
* It always throws.
|
|
118
|
+
*/
|
|
119
|
+
|
|
108
120
|
/**
|
|
109
121
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
110
|
-
* All rights reserved.
|
|
111
122
|
*
|
|
112
|
-
* This source code is licensed under the
|
|
113
|
-
* LICENSE file in the root directory of this source tree.
|
|
114
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
123
|
+
* This source code is licensed under the MIT license found in the
|
|
124
|
+
* LICENSE file in the root directory of this source tree.
|
|
115
125
|
*
|
|
116
|
-
* @providesModule reactProdInvariant
|
|
117
|
-
*
|
|
118
126
|
*/
|
|
119
127
|
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Use invariant() to assert state which your program assumes to be true.
|
|
132
|
+
*
|
|
133
|
+
* Provide sprintf-style format (only %s is supported) and arguments
|
|
134
|
+
* to provide information about what broke and what you were
|
|
135
|
+
* expecting.
|
|
136
|
+
*
|
|
137
|
+
* The invariant message will be stripped in production, but the invariant
|
|
138
|
+
* will remain to ensure logic does not differ in production.
|
|
139
|
+
*/
|
|
140
|
+
|
|
141
|
+
var validateFormat = function validateFormat(format) {};
|
|
142
|
+
|
|
143
|
+
{
|
|
144
|
+
validateFormat = function validateFormat(format) {
|
|
145
|
+
if (format === undefined) {
|
|
146
|
+
throw new Error('invariant requires an error message argument');
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function invariant(condition, format, a, b, c, d, e, f) {
|
|
152
|
+
validateFormat(format);
|
|
153
|
+
|
|
154
|
+
if (!condition) {
|
|
155
|
+
var error;
|
|
156
|
+
if (format === undefined) {
|
|
157
|
+
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
|
158
|
+
} else {
|
|
159
|
+
var args = [a, b, c, d, e, f];
|
|
160
|
+
var argIndex = 0;
|
|
161
|
+
error = new Error(format.replace(/%s/g, function () {
|
|
162
|
+
return args[argIndex++];
|
|
163
|
+
}));
|
|
164
|
+
error.name = 'Invariant Violation';
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
error.framesToPop = 1; // we don't care about invariant's own frame
|
|
168
|
+
throw error;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
var invariant_1$1 = invariant;
|
|
173
|
+
|
|
174
|
+
// Exports React.Fragment
|
|
175
|
+
var enableReactFragment = false;
|
|
176
|
+
// Exports ReactDOM.createRoot
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
// Mutating mode (React DOM, React ART, React Native):
|
|
181
|
+
|
|
182
|
+
// Experimental noop mode (currently unused):
|
|
183
|
+
|
|
184
|
+
// Experimental persistent mode (CS):
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
// Only used in www builds.
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
191
|
+
*
|
|
192
|
+
* This source code is licensed under the MIT license found in the
|
|
193
|
+
* LICENSE file in the root directory of this source tree.
|
|
194
|
+
*
|
|
195
|
+
*/
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
var emptyObject = {};
|
|
200
|
+
|
|
201
|
+
{
|
|
202
|
+
Object.freeze(emptyObject);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
var emptyObject_1 = emptyObject;
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Forked from fbjs/warning:
|
|
209
|
+
* https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
|
|
210
|
+
*
|
|
211
|
+
* Only change is we use console.warn instead of console.error,
|
|
212
|
+
* and do nothing when 'console' is not supported.
|
|
213
|
+
* This really simplifies the code.
|
|
214
|
+
* ---
|
|
215
|
+
* Similar to invariant but only logs a warning if the condition is not met.
|
|
216
|
+
* This can be used to log issues in development environments in critical
|
|
217
|
+
* paths. Removing the logging code for production environments will keep the
|
|
218
|
+
* same logic and follow the same code paths.
|
|
219
|
+
*/
|
|
220
|
+
|
|
221
|
+
var lowPriorityWarning = function () {};
|
|
222
|
+
|
|
223
|
+
{
|
|
224
|
+
var printWarning = function (format) {
|
|
225
|
+
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
226
|
+
args[_key - 1] = arguments[_key];
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
var argIndex = 0;
|
|
230
|
+
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
231
|
+
return args[argIndex++];
|
|
232
|
+
});
|
|
233
|
+
if (typeof console !== 'undefined') {
|
|
234
|
+
console.warn(message);
|
|
235
|
+
}
|
|
236
|
+
try {
|
|
237
|
+
// --- Welcome to debugging React ---
|
|
238
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
239
|
+
// to find the callsite that caused this warning to fire.
|
|
240
|
+
throw new Error(message);
|
|
241
|
+
} catch (x) {}
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
lowPriorityWarning = function (condition, format) {
|
|
245
|
+
if (format === undefined) {
|
|
246
|
+
throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
|
|
247
|
+
}
|
|
248
|
+
if (!condition) {
|
|
249
|
+
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
250
|
+
args[_key2 - 2] = arguments[_key2];
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
printWarning.apply(undefined, [format].concat(args));
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
var lowPriorityWarning$1 = lowPriorityWarning;
|
|
259
|
+
|
|
120
260
|
/**
|
|
121
261
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
122
|
-
* All rights reserved.
|
|
123
262
|
*
|
|
124
|
-
* This source code is licensed under the
|
|
125
|
-
* LICENSE file in the root directory of this source tree.
|
|
126
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
263
|
+
* This source code is licensed under the MIT license found in the
|
|
264
|
+
* LICENSE file in the root directory of this source tree.
|
|
127
265
|
*
|
|
128
266
|
*
|
|
129
267
|
*/
|
|
@@ -154,6 +292,18 @@ emptyFunction.thatReturnsArgument = function (arg) {
|
|
|
154
292
|
|
|
155
293
|
var emptyFunction_1 = emptyFunction;
|
|
156
294
|
|
|
295
|
+
/**
|
|
296
|
+
* Copyright (c) 2014-present, Facebook, Inc.
|
|
297
|
+
*
|
|
298
|
+
* This source code is licensed under the MIT license found in the
|
|
299
|
+
* LICENSE file in the root directory of this source tree.
|
|
300
|
+
*
|
|
301
|
+
*/
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
|
|
157
307
|
/**
|
|
158
308
|
* Similar to invariant but only logs a warning if the condition is not met.
|
|
159
309
|
* This can be used to log issues in development environments in critical
|
|
@@ -161,10 +311,10 @@ var emptyFunction_1 = emptyFunction;
|
|
|
161
311
|
* same logic and follow the same code paths.
|
|
162
312
|
*/
|
|
163
313
|
|
|
164
|
-
var warning
|
|
314
|
+
var warning = emptyFunction_1;
|
|
165
315
|
|
|
166
316
|
{
|
|
167
|
-
var printWarning = function printWarning(format) {
|
|
317
|
+
var printWarning$1 = function printWarning(format) {
|
|
168
318
|
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
169
319
|
args[_key - 1] = arguments[_key];
|
|
170
320
|
}
|
|
@@ -184,7 +334,7 @@ var warning$1 = emptyFunction_1;
|
|
|
184
334
|
} catch (x) {}
|
|
185
335
|
};
|
|
186
336
|
|
|
187
|
-
warning
|
|
337
|
+
warning = function warning(condition, format) {
|
|
188
338
|
if (format === undefined) {
|
|
189
339
|
throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
|
|
190
340
|
}
|
|
@@ -198,21 +348,25 @@ var warning$1 = emptyFunction_1;
|
|
|
198
348
|
args[_key2 - 2] = arguments[_key2];
|
|
199
349
|
}
|
|
200
350
|
|
|
201
|
-
printWarning.apply(undefined, [format].concat(args));
|
|
351
|
+
printWarning$1.apply(undefined, [format].concat(args));
|
|
202
352
|
}
|
|
203
353
|
};
|
|
204
354
|
}
|
|
205
355
|
|
|
206
|
-
var warning_1 = warning
|
|
356
|
+
var warning_1$1 = warning;
|
|
207
357
|
|
|
208
|
-
{
|
|
209
|
-
var warning = warning_1;
|
|
210
|
-
}
|
|
358
|
+
var didWarnStateUpdateForUnmountedComponent = {};
|
|
211
359
|
|
|
212
360
|
function warnNoop(publicInstance, callerName) {
|
|
213
361
|
{
|
|
214
362
|
var constructor = publicInstance.constructor;
|
|
215
|
-
|
|
363
|
+
var componentName = constructor && (constructor.displayName || constructor.name) || 'ReactClass';
|
|
364
|
+
var warningKey = componentName + '.' + callerName;
|
|
365
|
+
if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
warning_1$1(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);
|
|
369
|
+
didWarnStateUpdateForUnmountedComponent[warningKey] = true;
|
|
216
370
|
}
|
|
217
371
|
}
|
|
218
372
|
|
|
@@ -284,157 +438,19 @@ var ReactNoopUpdateQueue = {
|
|
|
284
438
|
}
|
|
285
439
|
};
|
|
286
440
|
|
|
287
|
-
var ReactNoopUpdateQueue_1 = ReactNoopUpdateQueue;
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
291
|
-
* All rights reserved.
|
|
292
|
-
*
|
|
293
|
-
* This source code is licensed under the BSD-style license found in the
|
|
294
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
295
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
296
|
-
*
|
|
297
|
-
*/
|
|
298
|
-
|
|
299
|
-
var emptyObject = {};
|
|
300
|
-
|
|
301
|
-
{
|
|
302
|
-
Object.freeze(emptyObject);
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
var emptyObject_1 = emptyObject;
|
|
306
|
-
|
|
307
|
-
/**
|
|
308
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
309
|
-
* All rights reserved.
|
|
310
|
-
*
|
|
311
|
-
* This source code is licensed under the BSD-style license found in the
|
|
312
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
313
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
314
|
-
*
|
|
315
|
-
*/
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* Use invariant() to assert state which your program assumes to be true.
|
|
319
|
-
*
|
|
320
|
-
* Provide sprintf-style format (only %s is supported) and arguments
|
|
321
|
-
* to provide information about what broke and what you were
|
|
322
|
-
* expecting.
|
|
323
|
-
*
|
|
324
|
-
* The invariant message will be stripped in production, but the invariant
|
|
325
|
-
* will remain to ensure logic does not differ in production.
|
|
326
|
-
*/
|
|
327
|
-
|
|
328
|
-
var validateFormat = function validateFormat(format) {};
|
|
329
|
-
|
|
330
|
-
{
|
|
331
|
-
validateFormat = function validateFormat(format) {
|
|
332
|
-
if (format === undefined) {
|
|
333
|
-
throw new Error('invariant requires an error message argument');
|
|
334
|
-
}
|
|
335
|
-
};
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
function invariant(condition, format, a, b, c, d, e, f) {
|
|
339
|
-
validateFormat(format);
|
|
340
|
-
|
|
341
|
-
if (!condition) {
|
|
342
|
-
var error;
|
|
343
|
-
if (format === undefined) {
|
|
344
|
-
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
|
345
|
-
} else {
|
|
346
|
-
var args = [a, b, c, d, e, f];
|
|
347
|
-
var argIndex = 0;
|
|
348
|
-
error = new Error(format.replace(/%s/g, function () {
|
|
349
|
-
return args[argIndex++];
|
|
350
|
-
}));
|
|
351
|
-
error.name = 'Invariant Violation';
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
error.framesToPop = 1; // we don't care about invariant's own frame
|
|
355
|
-
throw error;
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
var invariant_1 = invariant;
|
|
360
|
-
|
|
361
|
-
/**
|
|
362
|
-
* Copyright 2014-2015, Facebook, Inc.
|
|
363
|
-
* All rights reserved.
|
|
364
|
-
*
|
|
365
|
-
* This source code is licensed under the BSD-style license found in the
|
|
366
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
367
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
368
|
-
*
|
|
369
|
-
* @providesModule lowPriorityWarning
|
|
370
|
-
*/
|
|
371
|
-
|
|
372
|
-
/**
|
|
373
|
-
* Forked from fbjs/warning:
|
|
374
|
-
* https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
|
|
375
|
-
*
|
|
376
|
-
* Only change is we use console.warn instead of console.error,
|
|
377
|
-
* and do nothing when 'console' is not supported.
|
|
378
|
-
* This really simplifies the code.
|
|
379
|
-
* ---
|
|
380
|
-
* Similar to invariant but only logs a warning if the condition is not met.
|
|
381
|
-
* This can be used to log issues in development environments in critical
|
|
382
|
-
* paths. Removing the logging code for production environments will keep the
|
|
383
|
-
* same logic and follow the same code paths.
|
|
384
|
-
*/
|
|
385
|
-
|
|
386
|
-
var lowPriorityWarning = function () {};
|
|
387
|
-
|
|
388
|
-
{
|
|
389
|
-
var printWarning$1 = function (format) {
|
|
390
|
-
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
391
|
-
args[_key - 1] = arguments[_key];
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
var argIndex = 0;
|
|
395
|
-
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
396
|
-
return args[argIndex++];
|
|
397
|
-
});
|
|
398
|
-
if (typeof console !== 'undefined') {
|
|
399
|
-
console.warn(message);
|
|
400
|
-
}
|
|
401
|
-
try {
|
|
402
|
-
// --- Welcome to debugging React ---
|
|
403
|
-
// This error was thrown as a convenience so that you can use this stack
|
|
404
|
-
// to find the callsite that caused this warning to fire.
|
|
405
|
-
throw new Error(message);
|
|
406
|
-
} catch (x) {}
|
|
407
|
-
};
|
|
408
|
-
|
|
409
|
-
lowPriorityWarning = function (condition, format) {
|
|
410
|
-
if (format === undefined) {
|
|
411
|
-
throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
|
|
412
|
-
}
|
|
413
|
-
if (!condition) {
|
|
414
|
-
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
415
|
-
args[_key2 - 2] = arguments[_key2];
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
printWarning$1.apply(undefined, [format].concat(args));
|
|
419
|
-
}
|
|
420
|
-
};
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
var lowPriorityWarning_1 = lowPriorityWarning;
|
|
424
|
-
|
|
425
441
|
/**
|
|
426
442
|
* Base class helpers for the updating state of a component.
|
|
427
443
|
*/
|
|
428
|
-
function
|
|
444
|
+
function Component(props, context, updater) {
|
|
429
445
|
this.props = props;
|
|
430
446
|
this.context = context;
|
|
431
447
|
this.refs = emptyObject_1;
|
|
432
448
|
// We initialize the default updater but the real one gets injected by the
|
|
433
449
|
// renderer.
|
|
434
|
-
this.updater = updater ||
|
|
450
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
435
451
|
}
|
|
436
452
|
|
|
437
|
-
|
|
453
|
+
Component.prototype.isReactComponent = {};
|
|
438
454
|
|
|
439
455
|
/**
|
|
440
456
|
* Sets a subset of the state. Always use this to mutate
|
|
@@ -461,8 +477,8 @@ ReactComponent.prototype.isReactComponent = {};
|
|
|
461
477
|
* @final
|
|
462
478
|
* @protected
|
|
463
479
|
*/
|
|
464
|
-
|
|
465
|
-
!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? invariant_1(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : void 0;
|
|
480
|
+
Component.prototype.setState = function (partialState, callback) {
|
|
481
|
+
!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? invariant_1$1(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : void 0;
|
|
466
482
|
this.updater.enqueueSetState(this, partialState, callback, 'setState');
|
|
467
483
|
};
|
|
468
484
|
|
|
@@ -480,7 +496,7 @@ ReactComponent.prototype.setState = function (partialState, callback) {
|
|
|
480
496
|
* @final
|
|
481
497
|
* @protected
|
|
482
498
|
*/
|
|
483
|
-
|
|
499
|
+
Component.prototype.forceUpdate = function (callback) {
|
|
484
500
|
this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
|
|
485
501
|
};
|
|
486
502
|
|
|
@@ -495,9 +511,9 @@ ReactComponent.prototype.forceUpdate = function (callback) {
|
|
|
495
511
|
replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
|
|
496
512
|
};
|
|
497
513
|
var defineDeprecationWarning = function (methodName, info) {
|
|
498
|
-
Object.defineProperty(
|
|
514
|
+
Object.defineProperty(Component.prototype, methodName, {
|
|
499
515
|
get: function () {
|
|
500
|
-
|
|
516
|
+
lowPriorityWarning$1(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
|
|
501
517
|
return undefined;
|
|
502
518
|
}
|
|
503
519
|
});
|
|
@@ -512,61 +528,43 @@ ReactComponent.prototype.forceUpdate = function (callback) {
|
|
|
512
528
|
/**
|
|
513
529
|
* Base class helpers for the updating state of a component.
|
|
514
530
|
*/
|
|
515
|
-
function
|
|
516
|
-
// Duplicated from
|
|
531
|
+
function PureComponent(props, context, updater) {
|
|
532
|
+
// Duplicated from Component.
|
|
517
533
|
this.props = props;
|
|
518
534
|
this.context = context;
|
|
519
535
|
this.refs = emptyObject_1;
|
|
520
536
|
// We initialize the default updater but the real one gets injected by the
|
|
521
537
|
// renderer.
|
|
522
|
-
this.updater = updater ||
|
|
538
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
523
539
|
}
|
|
524
540
|
|
|
525
541
|
function ComponentDummy() {}
|
|
526
|
-
ComponentDummy.prototype =
|
|
527
|
-
var pureComponentPrototype =
|
|
528
|
-
pureComponentPrototype.constructor =
|
|
542
|
+
ComponentDummy.prototype = Component.prototype;
|
|
543
|
+
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
|
544
|
+
pureComponentPrototype.constructor = PureComponent;
|
|
529
545
|
// Avoid an extra prototype jump for these methods.
|
|
530
|
-
|
|
546
|
+
objectAssign$1(pureComponentPrototype, Component.prototype);
|
|
531
547
|
pureComponentPrototype.isPureReactComponent = true;
|
|
532
548
|
|
|
533
|
-
function
|
|
534
|
-
// Duplicated from
|
|
549
|
+
function AsyncComponent(props, context, updater) {
|
|
550
|
+
// Duplicated from Component.
|
|
535
551
|
this.props = props;
|
|
536
552
|
this.context = context;
|
|
537
553
|
this.refs = emptyObject_1;
|
|
538
554
|
// We initialize the default updater but the real one gets injected by the
|
|
539
555
|
// renderer.
|
|
540
|
-
this.updater = updater ||
|
|
556
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
541
557
|
}
|
|
542
558
|
|
|
543
|
-
var asyncComponentPrototype =
|
|
544
|
-
asyncComponentPrototype.constructor =
|
|
559
|
+
var asyncComponentPrototype = AsyncComponent.prototype = new ComponentDummy();
|
|
560
|
+
asyncComponentPrototype.constructor = AsyncComponent;
|
|
545
561
|
// Avoid an extra prototype jump for these methods.
|
|
546
|
-
|
|
562
|
+
objectAssign$1(asyncComponentPrototype, Component.prototype);
|
|
547
563
|
asyncComponentPrototype.unstable_isAsyncReactComponent = true;
|
|
548
564
|
asyncComponentPrototype.render = function () {
|
|
549
565
|
return this.props.children;
|
|
550
566
|
};
|
|
551
567
|
|
|
552
|
-
var ReactBaseClasses = {
|
|
553
|
-
Component: ReactComponent,
|
|
554
|
-
PureComponent: ReactPureComponent,
|
|
555
|
-
AsyncComponent: ReactAsyncComponent
|
|
556
|
-
};
|
|
557
|
-
|
|
558
|
-
/**
|
|
559
|
-
* Copyright 2013-present, Facebook, Inc.
|
|
560
|
-
* All rights reserved.
|
|
561
|
-
*
|
|
562
|
-
* This source code is licensed under the BSD-style license found in the
|
|
563
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
564
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
565
|
-
*
|
|
566
|
-
* @providesModule ReactCurrentOwner
|
|
567
|
-
*
|
|
568
|
-
*/
|
|
569
|
-
|
|
570
568
|
/**
|
|
571
569
|
* Keeps track of the current owner.
|
|
572
570
|
*
|
|
@@ -581,14 +579,8 @@ var ReactCurrentOwner = {
|
|
|
581
579
|
current: null
|
|
582
580
|
};
|
|
583
581
|
|
|
584
|
-
var ReactCurrentOwner_1 = ReactCurrentOwner;
|
|
585
|
-
|
|
586
582
|
var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
587
583
|
|
|
588
|
-
{
|
|
589
|
-
var warning$3 = warning_1;
|
|
590
|
-
}
|
|
591
|
-
|
|
592
584
|
// The Symbol used to tag the ReactElement type. If there is no native Symbol
|
|
593
585
|
// nor polyfill, then a plain number is used for performance.
|
|
594
586
|
var REACT_ELEMENT_TYPE$1 = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
|
|
@@ -631,7 +623,7 @@ function defineKeyPropWarningGetter(props, displayName) {
|
|
|
631
623
|
var warnAboutAccessingKey = function () {
|
|
632
624
|
if (!specialPropKeyWarningShown) {
|
|
633
625
|
specialPropKeyWarningShown = true;
|
|
634
|
-
|
|
626
|
+
warning_1$1(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);
|
|
635
627
|
}
|
|
636
628
|
};
|
|
637
629
|
warnAboutAccessingKey.isReactWarning = true;
|
|
@@ -645,7 +637,7 @@ function defineRefPropWarningGetter(props, displayName) {
|
|
|
645
637
|
var warnAboutAccessingRef = function () {
|
|
646
638
|
if (!specialPropRefWarningShown) {
|
|
647
639
|
specialPropRefWarningShown = true;
|
|
648
|
-
|
|
640
|
+
warning_1$1(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);
|
|
649
641
|
}
|
|
650
642
|
};
|
|
651
643
|
warnAboutAccessingRef.isReactWarning = true;
|
|
@@ -733,9 +725,9 @@ var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
|
733
725
|
|
|
734
726
|
/**
|
|
735
727
|
* Create and return a new ReactElement of the given type.
|
|
736
|
-
* See https://
|
|
728
|
+
* See https://reactjs.org/docs/react-api.html#createelement
|
|
737
729
|
*/
|
|
738
|
-
|
|
730
|
+
function createElement(type, config, children) {
|
|
739
731
|
var propName;
|
|
740
732
|
|
|
741
733
|
// Reserved names are extracted
|
|
@@ -804,39 +796,30 @@ ReactElement.createElement = function (type, config, children) {
|
|
|
804
796
|
}
|
|
805
797
|
}
|
|
806
798
|
}
|
|
807
|
-
return ReactElement(type, key, ref, self, source,
|
|
808
|
-
}
|
|
799
|
+
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
800
|
+
}
|
|
809
801
|
|
|
810
802
|
/**
|
|
811
803
|
* Return a function that produces ReactElements of a given type.
|
|
812
|
-
* See https://
|
|
804
|
+
* See https://reactjs.org/docs/react-api.html#createfactory
|
|
813
805
|
*/
|
|
814
|
-
ReactElement.createFactory = function (type) {
|
|
815
|
-
var factory = ReactElement.createElement.bind(null, type);
|
|
816
|
-
// Expose the type on the factory and the prototype so that it can be
|
|
817
|
-
// easily accessed on elements. E.g. `<Foo />.type === Foo`.
|
|
818
|
-
// This should not be named `constructor` since this may not be the function
|
|
819
|
-
// that created the element, and it may not even be a constructor.
|
|
820
|
-
// Legacy hook TODO: Warn if this is accessed
|
|
821
|
-
factory.type = type;
|
|
822
|
-
return factory;
|
|
823
|
-
};
|
|
824
806
|
|
|
825
|
-
|
|
807
|
+
|
|
808
|
+
function cloneAndReplaceKey(oldElement, newKey) {
|
|
826
809
|
var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
|
|
827
810
|
|
|
828
811
|
return newElement;
|
|
829
|
-
}
|
|
812
|
+
}
|
|
830
813
|
|
|
831
814
|
/**
|
|
832
815
|
* Clone and return a new ReactElement using element as the starting point.
|
|
833
|
-
* See https://
|
|
816
|
+
* See https://reactjs.org/docs/react-api.html#cloneelement
|
|
834
817
|
*/
|
|
835
|
-
|
|
818
|
+
function cloneElement(element, config, children) {
|
|
836
819
|
var propName;
|
|
837
820
|
|
|
838
821
|
// Original props are copied
|
|
839
|
-
var props =
|
|
822
|
+
var props = objectAssign$1({}, element.props);
|
|
840
823
|
|
|
841
824
|
// Reserved names are extracted
|
|
842
825
|
var key = element.key;
|
|
@@ -855,7 +838,7 @@ ReactElement.cloneElement = function (element, config, children) {
|
|
|
855
838
|
if (hasValidRef(config)) {
|
|
856
839
|
// Silently steal the ref from the parent.
|
|
857
840
|
ref = config.ref;
|
|
858
|
-
owner =
|
|
841
|
+
owner = ReactCurrentOwner.current;
|
|
859
842
|
}
|
|
860
843
|
if (hasValidKey(config)) {
|
|
861
844
|
key = '' + config.key;
|
|
@@ -892,32 +875,18 @@ ReactElement.cloneElement = function (element, config, children) {
|
|
|
892
875
|
}
|
|
893
876
|
|
|
894
877
|
return ReactElement(element.type, key, ref, self, source, owner, props);
|
|
895
|
-
}
|
|
878
|
+
}
|
|
896
879
|
|
|
897
880
|
/**
|
|
898
881
|
* Verifies the object is a ReactElement.
|
|
899
|
-
* See https://
|
|
882
|
+
* See https://reactjs.org/docs/react-api.html#isvalidelement
|
|
900
883
|
* @param {?object} object
|
|
901
884
|
* @return {boolean} True if `object` is a valid component.
|
|
902
885
|
* @final
|
|
903
886
|
*/
|
|
904
|
-
|
|
887
|
+
function isValidElement(object) {
|
|
905
888
|
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE$1;
|
|
906
|
-
}
|
|
907
|
-
|
|
908
|
-
var ReactElement_1 = ReactElement;
|
|
909
|
-
|
|
910
|
-
/**
|
|
911
|
-
* Copyright 2013-present, Facebook, Inc.
|
|
912
|
-
* All rights reserved.
|
|
913
|
-
*
|
|
914
|
-
* This source code is licensed under the BSD-style license found in the
|
|
915
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
916
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
917
|
-
*
|
|
918
|
-
* @providesModule ReactDebugCurrentFrame
|
|
919
|
-
*
|
|
920
|
-
*/
|
|
889
|
+
}
|
|
921
890
|
|
|
922
891
|
var ReactDebugCurrentFrame = {};
|
|
923
892
|
|
|
@@ -934,21 +903,12 @@ var ReactDebugCurrentFrame = {};
|
|
|
934
903
|
};
|
|
935
904
|
}
|
|
936
905
|
|
|
937
|
-
var ReactDebugCurrentFrame_1 = ReactDebugCurrentFrame;
|
|
938
|
-
|
|
939
|
-
{
|
|
940
|
-
var warning$2 = warning_1;
|
|
941
|
-
|
|
942
|
-
var _require = ReactDebugCurrentFrame_1,
|
|
943
|
-
getStackAddendum = _require.getStackAddendum;
|
|
944
|
-
}
|
|
945
|
-
|
|
946
906
|
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
947
907
|
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
|
948
908
|
// The Symbol used to tag the ReactElement type. If there is no native Symbol
|
|
949
909
|
// nor polyfill, then a plain number is used for performance.
|
|
950
910
|
var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
|
|
951
|
-
|
|
911
|
+
var REACT_PORTAL_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.portal') || 0xeaca;
|
|
952
912
|
var SEPARATOR = '.';
|
|
953
913
|
var SUBSEPARATOR = ':';
|
|
954
914
|
|
|
@@ -1035,7 +995,7 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
|
|
|
1035
995
|
if (children === null || type === 'string' || type === 'number' ||
|
|
1036
996
|
// The following is inlined from ReactElement. This means we can optimize
|
|
1037
997
|
// some checks. React Fiber also inlines this logic for similar purposes.
|
|
1038
|
-
type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) {
|
|
998
|
+
type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE || type === 'object' && children.$$typeof === REACT_PORTAL_TYPE) {
|
|
1039
999
|
callback(traverseContext, children,
|
|
1040
1000
|
// If it's the only child, treat the name as if it was wrapped in an array
|
|
1041
1001
|
// so that it's consistent if the number of children grows.
|
|
@@ -1060,7 +1020,7 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
|
|
|
1060
1020
|
{
|
|
1061
1021
|
// Warn about using Maps as children
|
|
1062
1022
|
if (iteratorFn === children.entries) {
|
|
1063
|
-
|
|
1023
|
+
warning_1$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', ReactDebugCurrentFrame.getStackAddendum());
|
|
1064
1024
|
didWarnAboutMaps = true;
|
|
1065
1025
|
}
|
|
1066
1026
|
}
|
|
@@ -1076,10 +1036,10 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
|
|
|
1076
1036
|
} else if (type === 'object') {
|
|
1077
1037
|
var addendum = '';
|
|
1078
1038
|
{
|
|
1079
|
-
addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + getStackAddendum();
|
|
1039
|
+
addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum();
|
|
1080
1040
|
}
|
|
1081
1041
|
var childrenString = '' + children;
|
|
1082
|
-
invariant_1(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum);
|
|
1042
|
+
invariant_1$1(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum);
|
|
1083
1043
|
}
|
|
1084
1044
|
}
|
|
1085
1045
|
|
|
@@ -1138,7 +1098,7 @@ function forEachSingleChild(bookKeeping, child, name) {
|
|
|
1138
1098
|
/**
|
|
1139
1099
|
* Iterates through children that are typically specified as `props.children`.
|
|
1140
1100
|
*
|
|
1141
|
-
* See https://
|
|
1101
|
+
* See https://reactjs.org/docs/react-api.html#react.children.foreach
|
|
1142
1102
|
*
|
|
1143
1103
|
* The provided forEachFunc(child, index) will be called for each
|
|
1144
1104
|
* leaf child.
|
|
@@ -1167,8 +1127,8 @@ function mapSingleChildIntoContext(bookKeeping, child, childKey) {
|
|
|
1167
1127
|
if (Array.isArray(mappedChild)) {
|
|
1168
1128
|
mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction_1.thatReturnsArgument);
|
|
1169
1129
|
} else if (mappedChild != null) {
|
|
1170
|
-
if (
|
|
1171
|
-
mappedChild =
|
|
1130
|
+
if (isValidElement(mappedChild)) {
|
|
1131
|
+
mappedChild = cloneAndReplaceKey(mappedChild,
|
|
1172
1132
|
// Keep both the (mapped) and old keys if they differ, just as
|
|
1173
1133
|
// traverseAllChildren used to do for objects as children
|
|
1174
1134
|
keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
|
|
@@ -1190,7 +1150,7 @@ function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
|
|
|
1190
1150
|
/**
|
|
1191
1151
|
* Maps children that are typically specified as `props.children`.
|
|
1192
1152
|
*
|
|
1193
|
-
* See https://
|
|
1153
|
+
* See https://reactjs.org/docs/react-api.html#react.children.map
|
|
1194
1154
|
*
|
|
1195
1155
|
* The provided mapFunction(child, key, index) will be called for each
|
|
1196
1156
|
* leaf child.
|
|
@@ -1213,7 +1173,7 @@ function mapChildren(children, func, context) {
|
|
|
1213
1173
|
* Count the number of children that are typically specified as
|
|
1214
1174
|
* `props.children`.
|
|
1215
1175
|
*
|
|
1216
|
-
* See https://
|
|
1176
|
+
* See https://reactjs.org/docs/react-api.html#react.children.count
|
|
1217
1177
|
*
|
|
1218
1178
|
* @param {?*} children Children tree container.
|
|
1219
1179
|
* @return {number} The number of children.
|
|
@@ -1226,7 +1186,7 @@ function countChildren(children, context) {
|
|
|
1226
1186
|
* Flatten a children object (typically specified as `props.children`) and
|
|
1227
1187
|
* return an array with appropriately re-keyed children.
|
|
1228
1188
|
*
|
|
1229
|
-
* See https://
|
|
1189
|
+
* See https://reactjs.org/docs/react-api.html#react.children.toarray
|
|
1230
1190
|
*/
|
|
1231
1191
|
function toArray(children) {
|
|
1232
1192
|
var result = [];
|
|
@@ -1234,33 +1194,11 @@ function toArray(children) {
|
|
|
1234
1194
|
return result;
|
|
1235
1195
|
}
|
|
1236
1196
|
|
|
1237
|
-
var ReactChildren = {
|
|
1238
|
-
forEach: forEachChildren,
|
|
1239
|
-
map: mapChildren,
|
|
1240
|
-
count: countChildren,
|
|
1241
|
-
toArray: toArray
|
|
1242
|
-
};
|
|
1243
|
-
|
|
1244
|
-
var ReactChildren_1 = ReactChildren;
|
|
1245
|
-
|
|
1246
|
-
/**
|
|
1247
|
-
* Copyright 2013-present, Facebook, Inc.
|
|
1248
|
-
* All rights reserved.
|
|
1249
|
-
*
|
|
1250
|
-
* This source code is licensed under the BSD-style license found in the
|
|
1251
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
1252
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
1253
|
-
*
|
|
1254
|
-
* @providesModule ReactVersion
|
|
1255
|
-
*/
|
|
1256
|
-
|
|
1257
|
-
var ReactVersion = '16.0.0-rc.3';
|
|
1258
|
-
|
|
1259
1197
|
/**
|
|
1260
1198
|
* Returns the first child in a collection of children and verifies that there
|
|
1261
1199
|
* is only one child in the collection.
|
|
1262
1200
|
*
|
|
1263
|
-
* See https://
|
|
1201
|
+
* See https://reactjs.org/docs/react-api.html#react.children.only
|
|
1264
1202
|
*
|
|
1265
1203
|
* The current implementation of this function assumes that a single child gets
|
|
1266
1204
|
* passed without a wrapper, but the purpose of this helper function is to
|
|
@@ -1271,28 +1209,51 @@ var ReactVersion = '16.0.0-rc.3';
|
|
|
1271
1209
|
* structure.
|
|
1272
1210
|
*/
|
|
1273
1211
|
function onlyChild(children) {
|
|
1274
|
-
!
|
|
1212
|
+
!isValidElement(children) ? invariant_1$1(false, 'React.Children.only expected to receive a single React element child.') : void 0;
|
|
1275
1213
|
return children;
|
|
1276
1214
|
}
|
|
1277
1215
|
|
|
1278
|
-
var
|
|
1216
|
+
var describeComponentFrame = function (name, source, ownerName) {
|
|
1217
|
+
return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
|
|
1218
|
+
};
|
|
1219
|
+
|
|
1220
|
+
function getComponentName(fiber) {
|
|
1221
|
+
var type = fiber.type;
|
|
1222
|
+
|
|
1223
|
+
if (typeof type === 'string') {
|
|
1224
|
+
return type;
|
|
1225
|
+
}
|
|
1226
|
+
if (typeof type === 'function') {
|
|
1227
|
+
return type.displayName || type.name;
|
|
1228
|
+
}
|
|
1229
|
+
return null;
|
|
1230
|
+
}
|
|
1279
1231
|
|
|
1280
1232
|
/**
|
|
1281
|
-
* Copyright 2013-present, Facebook, Inc.
|
|
1282
|
-
* All rights reserved.
|
|
1233
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
1283
1234
|
*
|
|
1284
|
-
* This source code is licensed under the
|
|
1285
|
-
* LICENSE file in the root directory of this source tree.
|
|
1286
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
1235
|
+
* This source code is licensed under the MIT license found in the
|
|
1236
|
+
* LICENSE file in the root directory of this source tree.
|
|
1287
1237
|
*/
|
|
1288
1238
|
|
|
1239
|
+
|
|
1240
|
+
|
|
1289
1241
|
var ReactPropTypesSecret$1 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
1290
1242
|
|
|
1291
1243
|
var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
|
|
1292
1244
|
|
|
1245
|
+
/**
|
|
1246
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
1247
|
+
*
|
|
1248
|
+
* This source code is licensed under the MIT license found in the
|
|
1249
|
+
* LICENSE file in the root directory of this source tree.
|
|
1250
|
+
*/
|
|
1251
|
+
|
|
1252
|
+
|
|
1253
|
+
|
|
1293
1254
|
{
|
|
1294
|
-
var invariant$2 = invariant_1;
|
|
1295
|
-
var warning$
|
|
1255
|
+
var invariant$2 = invariant_1$1;
|
|
1256
|
+
var warning$2 = warning_1$1;
|
|
1296
1257
|
var ReactPropTypesSecret = ReactPropTypesSecret_1;
|
|
1297
1258
|
var loggedTypeFailures = {};
|
|
1298
1259
|
}
|
|
@@ -1308,7 +1269,7 @@ var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
|
|
|
1308
1269
|
* @param {?Function} getStack Returns the component stack.
|
|
1309
1270
|
* @private
|
|
1310
1271
|
*/
|
|
1311
|
-
function checkPropTypes
|
|
1272
|
+
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
1312
1273
|
{
|
|
1313
1274
|
for (var typeSpecName in typeSpecs) {
|
|
1314
1275
|
if (typeSpecs.hasOwnProperty(typeSpecName)) {
|
|
@@ -1319,12 +1280,12 @@ function checkPropTypes$1(typeSpecs, values, location, componentName, getStack)
|
|
|
1319
1280
|
try {
|
|
1320
1281
|
// This is intentionally an invariant that gets caught. It's the same
|
|
1321
1282
|
// behavior as without this statement except with a better message.
|
|
1322
|
-
invariant$2(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + '
|
|
1283
|
+
invariant$2(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`.', componentName || 'React class', location, typeSpecName, typeof typeSpecs[typeSpecName]);
|
|
1323
1284
|
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
|
1324
1285
|
} catch (ex) {
|
|
1325
1286
|
error = ex;
|
|
1326
1287
|
}
|
|
1327
|
-
warning$
|
|
1288
|
+
warning$2(!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);
|
|
1328
1289
|
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
1329
1290
|
// Only monitor this failure once because there tends to be a lot of the
|
|
1330
1291
|
// same error.
|
|
@@ -1332,74 +1293,23 @@ function checkPropTypes$1(typeSpecs, values, location, componentName, getStack)
|
|
|
1332
1293
|
|
|
1333
1294
|
var stack = getStack ? getStack() : '';
|
|
1334
1295
|
|
|
1335
|
-
warning$
|
|
1296
|
+
warning$2(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
|
|
1336
1297
|
}
|
|
1337
1298
|
}
|
|
1338
1299
|
}
|
|
1339
1300
|
}
|
|
1340
1301
|
}
|
|
1341
1302
|
|
|
1342
|
-
var checkPropTypes_1 = checkPropTypes
|
|
1343
|
-
|
|
1344
|
-
/**
|
|
1345
|
-
* Copyright 2016-present, Facebook, Inc.
|
|
1346
|
-
* All rights reserved.
|
|
1347
|
-
*
|
|
1348
|
-
* This source code is licensed under the BSD-style license found in the
|
|
1349
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
1350
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
1351
|
-
*
|
|
1352
|
-
*
|
|
1353
|
-
* @providesModule describeComponentFrame
|
|
1354
|
-
*/
|
|
1355
|
-
|
|
1356
|
-
var describeComponentFrame$1 = function (name, source, ownerName) {
|
|
1357
|
-
return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
|
|
1358
|
-
};
|
|
1303
|
+
var checkPropTypes_1$1 = checkPropTypes;
|
|
1359
1304
|
|
|
1360
1305
|
/**
|
|
1361
|
-
*
|
|
1362
|
-
*
|
|
1363
|
-
*
|
|
1364
|
-
*
|
|
1365
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
1366
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
1367
|
-
*
|
|
1368
|
-
* @providesModule getComponentName
|
|
1369
|
-
*
|
|
1306
|
+
* ReactElementValidator provides a wrapper around a element factory
|
|
1307
|
+
* which validates the props passed to the element. This is intended to be
|
|
1308
|
+
* used only in DEV and could be replaced by a static type checker for languages
|
|
1309
|
+
* that support it.
|
|
1370
1310
|
*/
|
|
1371
1311
|
|
|
1372
|
-
function getComponentName$1(instanceOrFiber) {
|
|
1373
|
-
if (typeof instanceOrFiber.getName === 'function') {
|
|
1374
|
-
// Stack reconciler
|
|
1375
|
-
var instance = instanceOrFiber;
|
|
1376
|
-
return instance.getName();
|
|
1377
|
-
}
|
|
1378
|
-
if (typeof instanceOrFiber.tag === 'number') {
|
|
1379
|
-
// Fiber reconciler
|
|
1380
|
-
var fiber = instanceOrFiber;
|
|
1381
|
-
var type = fiber.type;
|
|
1382
|
-
|
|
1383
|
-
if (typeof type === 'string') {
|
|
1384
|
-
return type;
|
|
1385
|
-
}
|
|
1386
|
-
if (typeof type === 'function') {
|
|
1387
|
-
return type.displayName || type.name;
|
|
1388
|
-
}
|
|
1389
|
-
}
|
|
1390
|
-
return null;
|
|
1391
|
-
}
|
|
1392
|
-
|
|
1393
|
-
var getComponentName_1 = getComponentName$1;
|
|
1394
|
-
|
|
1395
1312
|
{
|
|
1396
|
-
var checkPropTypes = checkPropTypes_1;
|
|
1397
|
-
var lowPriorityWarning$1 = lowPriorityWarning_1;
|
|
1398
|
-
var ReactDebugCurrentFrame$1 = ReactDebugCurrentFrame_1;
|
|
1399
|
-
var warning$4 = warning_1;
|
|
1400
|
-
var describeComponentFrame = describeComponentFrame$1;
|
|
1401
|
-
var getComponentName = getComponentName_1;
|
|
1402
|
-
|
|
1403
1313
|
var currentlyValidatingElement = null;
|
|
1404
1314
|
|
|
1405
1315
|
var getDisplayName = function (element) {
|
|
@@ -1409,29 +1319,35 @@ var getComponentName_1 = getComponentName$1;
|
|
|
1409
1319
|
return '#text';
|
|
1410
1320
|
} else if (typeof element.type === 'string') {
|
|
1411
1321
|
return element.type;
|
|
1322
|
+
} else if (element.type === REACT_FRAGMENT_TYPE$1) {
|
|
1323
|
+
return 'React.Fragment';
|
|
1412
1324
|
} else {
|
|
1413
1325
|
return element.type.displayName || element.type.name || 'Unknown';
|
|
1414
1326
|
}
|
|
1415
1327
|
};
|
|
1416
1328
|
|
|
1417
|
-
var getStackAddendum
|
|
1329
|
+
var getStackAddendum = function () {
|
|
1418
1330
|
var stack = '';
|
|
1419
1331
|
if (currentlyValidatingElement) {
|
|
1420
1332
|
var name = getDisplayName(currentlyValidatingElement);
|
|
1421
1333
|
var owner = currentlyValidatingElement._owner;
|
|
1422
1334
|
stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner));
|
|
1423
1335
|
}
|
|
1424
|
-
stack += ReactDebugCurrentFrame
|
|
1336
|
+
stack += ReactDebugCurrentFrame.getStackAddendum() || '';
|
|
1425
1337
|
return stack;
|
|
1426
1338
|
};
|
|
1339
|
+
|
|
1340
|
+
var REACT_FRAGMENT_TYPE$1 = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.fragment') || 0xeacb;
|
|
1341
|
+
|
|
1342
|
+
var VALID_FRAGMENT_PROPS = new Map([['children', true], ['key', true]]);
|
|
1427
1343
|
}
|
|
1428
1344
|
|
|
1429
1345
|
var ITERATOR_SYMBOL$1 = typeof Symbol === 'function' && Symbol.iterator;
|
|
1430
1346
|
var FAUX_ITERATOR_SYMBOL$1 = '@@iterator'; // Before Symbol spec.
|
|
1431
1347
|
|
|
1432
1348
|
function getDeclarationErrorAddendum() {
|
|
1433
|
-
if (
|
|
1434
|
-
var name = getComponentName(
|
|
1349
|
+
if (ReactCurrentOwner.current) {
|
|
1350
|
+
var name = getComponentName(ReactCurrentOwner.current);
|
|
1435
1351
|
if (name) {
|
|
1436
1352
|
return '\n\nCheck the render method of `' + name + '`.';
|
|
1437
1353
|
}
|
|
@@ -1495,14 +1411,14 @@ function validateExplicitKey(element, parentType) {
|
|
|
1495
1411
|
// property, it may be the creator of the child that's responsible for
|
|
1496
1412
|
// assigning it a key.
|
|
1497
1413
|
var childOwner = '';
|
|
1498
|
-
if (element && element._owner && element._owner !==
|
|
1414
|
+
if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
|
|
1499
1415
|
// Give the component that originally created this child.
|
|
1500
1416
|
childOwner = ' It was passed a child from ' + getComponentName(element._owner) + '.';
|
|
1501
1417
|
}
|
|
1502
1418
|
|
|
1503
1419
|
currentlyValidatingElement = element;
|
|
1504
1420
|
{
|
|
1505
|
-
|
|
1421
|
+
warning_1$1(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());
|
|
1506
1422
|
}
|
|
1507
1423
|
currentlyValidatingElement = null;
|
|
1508
1424
|
}
|
|
@@ -1523,11 +1439,11 @@ function validateChildKeys(node, parentType) {
|
|
|
1523
1439
|
if (Array.isArray(node)) {
|
|
1524
1440
|
for (var i = 0; i < node.length; i++) {
|
|
1525
1441
|
var child = node[i];
|
|
1526
|
-
if (
|
|
1442
|
+
if (isValidElement(child)) {
|
|
1527
1443
|
validateExplicitKey(child, parentType);
|
|
1528
1444
|
}
|
|
1529
1445
|
}
|
|
1530
|
-
} else if (
|
|
1446
|
+
} else if (isValidElement(node)) {
|
|
1531
1447
|
// This element was passed in a valid location.
|
|
1532
1448
|
if (node._store) {
|
|
1533
1449
|
node._store.validated = true;
|
|
@@ -1541,7 +1457,7 @@ function validateChildKeys(node, parentType) {
|
|
|
1541
1457
|
var iterator = iteratorFn.call(node);
|
|
1542
1458
|
var step;
|
|
1543
1459
|
while (!(step = iterator.next()).done) {
|
|
1544
|
-
if (
|
|
1460
|
+
if (isValidElement(step.value)) {
|
|
1545
1461
|
validateExplicitKey(step.value, parentType);
|
|
1546
1462
|
}
|
|
1547
1463
|
}
|
|
@@ -1562,464 +1478,195 @@ function validatePropTypes(element) {
|
|
|
1562
1478
|
return;
|
|
1563
1479
|
}
|
|
1564
1480
|
var name = componentClass.displayName || componentClass.name;
|
|
1565
|
-
|
|
1566
|
-
// ReactNative `View.propTypes` have been deprecated in favor of `ViewPropTypes`.
|
|
1567
|
-
// In their place a temporary getter has been added with a deprecated warning message.
|
|
1568
|
-
// Avoid triggering that warning during validation using the temporary workaround,
|
|
1569
|
-
// __propTypesSecretDontUseThesePlease.
|
|
1570
|
-
// TODO (bvaughn) Revert this particular change any time after April 1 ReactNative tag.
|
|
1571
|
-
var propTypes = typeof componentClass.__propTypesSecretDontUseThesePlease === 'object' ? componentClass.__propTypesSecretDontUseThesePlease : componentClass.propTypes;
|
|
1481
|
+
var propTypes = componentClass.propTypes;
|
|
1572
1482
|
|
|
1573
1483
|
if (propTypes) {
|
|
1574
1484
|
currentlyValidatingElement = element;
|
|
1575
|
-
|
|
1485
|
+
checkPropTypes_1$1(propTypes, element.props, 'prop', name, getStackAddendum);
|
|
1576
1486
|
currentlyValidatingElement = null;
|
|
1577
1487
|
}
|
|
1578
1488
|
if (typeof componentClass.getDefaultProps === 'function') {
|
|
1579
|
-
|
|
1489
|
+
warning_1$1(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
|
|
1580
1490
|
}
|
|
1581
1491
|
}
|
|
1582
1492
|
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
var info = '';
|
|
1590
|
-
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
|
1591
|
-
info += ' You likely forgot to export your component from the file ' + "it's defined in.";
|
|
1592
|
-
}
|
|
1593
|
-
|
|
1594
|
-
var sourceInfo = getSourceInfoErrorAddendum(props);
|
|
1595
|
-
if (sourceInfo) {
|
|
1596
|
-
info += sourceInfo;
|
|
1597
|
-
} else {
|
|
1598
|
-
info += getDeclarationErrorAddendum();
|
|
1599
|
-
}
|
|
1600
|
-
|
|
1601
|
-
info += ReactDebugCurrentFrame$1.getStackAddendum() || '';
|
|
1493
|
+
/**
|
|
1494
|
+
* Given a fragment, validate that it can only be provided with fragment props
|
|
1495
|
+
* @param {ReactElement} fragment
|
|
1496
|
+
*/
|
|
1497
|
+
function validateFragmentProps(fragment) {
|
|
1498
|
+
currentlyValidatingElement = fragment;
|
|
1602
1499
|
|
|
1603
|
-
|
|
1604
|
-
|
|
1500
|
+
var _iteratorNormalCompletion = true;
|
|
1501
|
+
var _didIteratorError = false;
|
|
1502
|
+
var _iteratorError = undefined;
|
|
1605
1503
|
|
|
1606
|
-
|
|
1504
|
+
try {
|
|
1505
|
+
for (var _iterator = Object.keys(fragment.props)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
1506
|
+
var key = _step.value;
|
|
1607
1507
|
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1508
|
+
if (!VALID_FRAGMENT_PROPS.has(key)) {
|
|
1509
|
+
warning_1$1(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.%s', key, getStackAddendum());
|
|
1510
|
+
break;
|
|
1511
|
+
}
|
|
1612
1512
|
}
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1513
|
+
} catch (err) {
|
|
1514
|
+
_didIteratorError = true;
|
|
1515
|
+
_iteratorError = err;
|
|
1516
|
+
} finally {
|
|
1517
|
+
try {
|
|
1518
|
+
if (!_iteratorNormalCompletion && _iterator['return']) {
|
|
1519
|
+
_iterator['return']();
|
|
1520
|
+
}
|
|
1521
|
+
} finally {
|
|
1522
|
+
if (_didIteratorError) {
|
|
1523
|
+
throw _iteratorError;
|
|
1622
1524
|
}
|
|
1623
1525
|
}
|
|
1526
|
+
}
|
|
1624
1527
|
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
},
|
|
1528
|
+
if (fragment.ref !== null) {
|
|
1529
|
+
warning_1$1(false, 'Invalid attribute `ref` supplied to `React.Fragment`.%s', getStackAddendum());
|
|
1530
|
+
}
|
|
1629
1531
|
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
// Legacy hook TODO: Warn if this is accessed
|
|
1633
|
-
validatedFactory.type = type;
|
|
1532
|
+
currentlyValidatingElement = null;
|
|
1533
|
+
}
|
|
1634
1534
|
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
return type;
|
|
1644
|
-
}
|
|
1645
|
-
});
|
|
1535
|
+
function createElementWithValidation(type, props, children) {
|
|
1536
|
+
var validType = typeof type === 'string' || typeof type === 'function' || typeof type === 'symbol' || typeof type === 'number';
|
|
1537
|
+
// We warn in this case but don't throw. We expect the element creation to
|
|
1538
|
+
// succeed and there will likely be errors in render.
|
|
1539
|
+
if (!validType) {
|
|
1540
|
+
var info = '';
|
|
1541
|
+
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
|
1542
|
+
info += ' You likely forgot to export your component from the file ' + "it's defined in.";
|
|
1646
1543
|
}
|
|
1647
1544
|
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
for (var i = 2; i < arguments.length; i++) {
|
|
1654
|
-
validateChildKeys(arguments[i], newElement.type);
|
|
1545
|
+
var sourceInfo = getSourceInfoErrorAddendum(props);
|
|
1546
|
+
if (sourceInfo) {
|
|
1547
|
+
info += sourceInfo;
|
|
1548
|
+
} else {
|
|
1549
|
+
info += getDeclarationErrorAddendum();
|
|
1655
1550
|
}
|
|
1656
|
-
validatePropTypes(newElement);
|
|
1657
|
-
return newElement;
|
|
1658
|
-
}
|
|
1659
|
-
};
|
|
1660
1551
|
|
|
1661
|
-
|
|
1552
|
+
info += getStackAddendum() || '';
|
|
1662
1553
|
|
|
1663
|
-
|
|
1664
|
-
var warning$6 = warning_1;
|
|
1665
|
-
}
|
|
1666
|
-
|
|
1667
|
-
function isNative(fn) {
|
|
1668
|
-
// Based on isNative() from Lodash
|
|
1669
|
-
var funcToString = Function.prototype.toString;
|
|
1670
|
-
var reIsNative = RegExp('^' + funcToString
|
|
1671
|
-
// Take an example native function source for comparison
|
|
1672
|
-
.call(Object.prototype.hasOwnProperty)
|
|
1673
|
-
// Strip regex characters so we can use it for regex
|
|
1674
|
-
.replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
|
|
1675
|
-
// Remove hasOwnProperty from the template to make it generic
|
|
1676
|
-
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
|
|
1677
|
-
try {
|
|
1678
|
-
var source = funcToString.call(fn);
|
|
1679
|
-
return reIsNative.test(source);
|
|
1680
|
-
} catch (err) {
|
|
1681
|
-
return false;
|
|
1554
|
+
warning_1$1(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);
|
|
1682
1555
|
}
|
|
1683
|
-
}
|
|
1684
1556
|
|
|
1685
|
-
var
|
|
1686
|
-
// Array.from
|
|
1687
|
-
typeof Array.from === 'function' &&
|
|
1688
|
-
// Map
|
|
1689
|
-
typeof Map === 'function' && isNative(Map) &&
|
|
1690
|
-
// Map.prototype.keys
|
|
1691
|
-
Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) &&
|
|
1692
|
-
// Set
|
|
1693
|
-
typeof Set === 'function' && isNative(Set) &&
|
|
1694
|
-
// Set.prototype.keys
|
|
1695
|
-
Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys);
|
|
1696
|
-
|
|
1697
|
-
var setItem;
|
|
1698
|
-
var getItem;
|
|
1699
|
-
var removeItem;
|
|
1700
|
-
var getItemIDs;
|
|
1701
|
-
var addRoot;
|
|
1702
|
-
var removeRoot;
|
|
1703
|
-
var getRootIDs;
|
|
1704
|
-
|
|
1705
|
-
if (canUseCollections) {
|
|
1706
|
-
var itemMap = new Map();
|
|
1707
|
-
var rootIDSet = new Set();
|
|
1708
|
-
|
|
1709
|
-
setItem = function (id, item) {
|
|
1710
|
-
itemMap.set(id, item);
|
|
1711
|
-
};
|
|
1712
|
-
getItem = function (id) {
|
|
1713
|
-
return itemMap.get(id);
|
|
1714
|
-
};
|
|
1715
|
-
removeItem = function (id) {
|
|
1716
|
-
itemMap['delete'](id);
|
|
1717
|
-
};
|
|
1718
|
-
getItemIDs = function () {
|
|
1719
|
-
return Array.from(itemMap.keys());
|
|
1720
|
-
};
|
|
1557
|
+
var element = createElement.apply(this, arguments);
|
|
1721
1558
|
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
};
|
|
1728
|
-
getRootIDs = function () {
|
|
1729
|
-
return Array.from(rootIDSet.keys());
|
|
1730
|
-
};
|
|
1731
|
-
} else {
|
|
1732
|
-
var itemByKey = {};
|
|
1733
|
-
var rootByKey = {};
|
|
1734
|
-
|
|
1735
|
-
// Use non-numeric keys to prevent V8 performance issues:
|
|
1736
|
-
// https://github.com/facebook/react/pull/7232
|
|
1737
|
-
var getKeyFromID = function (id) {
|
|
1738
|
-
return '.' + id;
|
|
1739
|
-
};
|
|
1740
|
-
var getIDFromKey = function (key) {
|
|
1741
|
-
return parseInt(key.substr(1), 10);
|
|
1742
|
-
};
|
|
1743
|
-
|
|
1744
|
-
setItem = function (id, item) {
|
|
1745
|
-
var key = getKeyFromID(id);
|
|
1746
|
-
itemByKey[key] = item;
|
|
1747
|
-
};
|
|
1748
|
-
getItem = function (id) {
|
|
1749
|
-
var key = getKeyFromID(id);
|
|
1750
|
-
return itemByKey[key];
|
|
1751
|
-
};
|
|
1752
|
-
removeItem = function (id) {
|
|
1753
|
-
var key = getKeyFromID(id);
|
|
1754
|
-
delete itemByKey[key];
|
|
1755
|
-
};
|
|
1756
|
-
getItemIDs = function () {
|
|
1757
|
-
return Object.keys(itemByKey).map(getIDFromKey);
|
|
1758
|
-
};
|
|
1759
|
-
|
|
1760
|
-
addRoot = function (id) {
|
|
1761
|
-
var key = getKeyFromID(id);
|
|
1762
|
-
rootByKey[key] = true;
|
|
1763
|
-
};
|
|
1764
|
-
removeRoot = function (id) {
|
|
1765
|
-
var key = getKeyFromID(id);
|
|
1766
|
-
delete rootByKey[key];
|
|
1767
|
-
};
|
|
1768
|
-
getRootIDs = function () {
|
|
1769
|
-
return Object.keys(rootByKey).map(getIDFromKey);
|
|
1770
|
-
};
|
|
1771
|
-
}
|
|
1772
|
-
|
|
1773
|
-
var unmountedIDs = [];
|
|
1774
|
-
|
|
1775
|
-
function purgeDeep(id) {
|
|
1776
|
-
var item = getItem(id);
|
|
1777
|
-
if (item) {
|
|
1778
|
-
var childIDs = item.childIDs;
|
|
1559
|
+
// The result can be nullish if a mock or a custom function is used.
|
|
1560
|
+
// TODO: Drop this when these are no longer allowed as the type argument.
|
|
1561
|
+
if (element == null) {
|
|
1562
|
+
return element;
|
|
1563
|
+
}
|
|
1779
1564
|
|
|
1780
|
-
|
|
1781
|
-
|
|
1565
|
+
// Skip key warning if the type isn't valid since our key validation logic
|
|
1566
|
+
// doesn't expect a non-string/function type and can throw confusing errors.
|
|
1567
|
+
// We don't want exception behavior to differ between dev and prod.
|
|
1568
|
+
// (Rendering will throw with a helpful message and as soon as the type is
|
|
1569
|
+
// fixed, the key warnings will appear.)
|
|
1570
|
+
if (validType) {
|
|
1571
|
+
for (var i = 2; i < arguments.length; i++) {
|
|
1572
|
+
validateChildKeys(arguments[i], type);
|
|
1573
|
+
}
|
|
1782
1574
|
}
|
|
1783
|
-
}
|
|
1784
1575
|
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
return '#empty';
|
|
1788
|
-
} else if (typeof element === 'string' || typeof element === 'number') {
|
|
1789
|
-
return '#text';
|
|
1790
|
-
} else if (typeof element.type === 'string') {
|
|
1791
|
-
return element.type;
|
|
1576
|
+
if (typeof type === 'symbol' && type === REACT_FRAGMENT_TYPE$1) {
|
|
1577
|
+
validateFragmentProps(element);
|
|
1792
1578
|
} else {
|
|
1793
|
-
|
|
1579
|
+
validatePropTypes(element);
|
|
1794
1580
|
}
|
|
1795
|
-
}
|
|
1796
|
-
|
|
1797
|
-
function describeID(id) {
|
|
1798
|
-
var name = ReactComponentTreeHook.getDisplayName(id);
|
|
1799
|
-
var element = ReactComponentTreeHook.getElement(id);
|
|
1800
|
-
var ownerID = ReactComponentTreeHook.getOwnerID(id);
|
|
1801
|
-
var ownerName = void 0;
|
|
1802
1581
|
|
|
1803
|
-
|
|
1804
|
-
ownerName = ReactComponentTreeHook.getDisplayName(ownerID);
|
|
1805
|
-
}
|
|
1806
|
-
warning$6(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id);
|
|
1807
|
-
return describeComponentFrame$1(name || '', element && element._source, ownerName || '');
|
|
1582
|
+
return element;
|
|
1808
1583
|
}
|
|
1809
1584
|
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
item.childIDs = nextChildIDs;
|
|
1815
|
-
|
|
1816
|
-
for (var i = 0; i < nextChildIDs.length; i++) {
|
|
1817
|
-
var nextChildID = nextChildIDs[i];
|
|
1818
|
-
var nextChild = getItem(nextChildID);
|
|
1819
|
-
!nextChild ? invariant_1(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : void 0;
|
|
1820
|
-
!(nextChild.childIDs != null || typeof nextChild.element !== 'object' || nextChild.element == null) ? invariant_1(false, 'Expected onSetChildren() to fire for a container child before its parent includes it in onSetChildren().') : void 0;
|
|
1821
|
-
!nextChild.isMounted ? invariant_1(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : void 0;
|
|
1822
|
-
if (nextChild.parentID == null) {
|
|
1823
|
-
nextChild.parentID = id;
|
|
1824
|
-
// TODO: This shouldn't be necessary but mounting a new root during in
|
|
1825
|
-
// componentWillMount currently causes not-yet-mounted components to
|
|
1826
|
-
// be purged from our tree data so their parent id is missing.
|
|
1827
|
-
}
|
|
1828
|
-
!(nextChild.parentID === id) ? invariant_1(false, 'Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (%s has parents %s and %s).', nextChildID, nextChild.parentID, id) : void 0;
|
|
1829
|
-
}
|
|
1830
|
-
},
|
|
1831
|
-
onBeforeMountComponent: function (id, element, parentID) {
|
|
1832
|
-
var item = {
|
|
1833
|
-
element: element,
|
|
1834
|
-
parentID: parentID,
|
|
1835
|
-
text: null,
|
|
1836
|
-
childIDs: [],
|
|
1837
|
-
isMounted: false,
|
|
1838
|
-
updateCount: 0
|
|
1839
|
-
};
|
|
1840
|
-
setItem(id, item);
|
|
1841
|
-
},
|
|
1842
|
-
onBeforeUpdateComponent: function (id, element) {
|
|
1843
|
-
var item = getItem(id);
|
|
1844
|
-
if (!item || !item.isMounted) {
|
|
1845
|
-
// We may end up here as a result of setState() in componentWillUnmount().
|
|
1846
|
-
// In this case, ignore the element.
|
|
1847
|
-
return;
|
|
1848
|
-
}
|
|
1849
|
-
item.element = element;
|
|
1850
|
-
},
|
|
1851
|
-
onMountComponent: function (id) {
|
|
1852
|
-
var item = getItem(id);
|
|
1853
|
-
!item ? invariant_1(false, 'Item must have been set') : void 0;
|
|
1854
|
-
item.isMounted = true;
|
|
1855
|
-
var isRoot = item.parentID === 0;
|
|
1856
|
-
if (isRoot) {
|
|
1857
|
-
addRoot(id);
|
|
1858
|
-
}
|
|
1859
|
-
},
|
|
1860
|
-
onUpdateComponent: function (id) {
|
|
1861
|
-
var item = getItem(id);
|
|
1862
|
-
if (!item || !item.isMounted) {
|
|
1863
|
-
// We may end up here as a result of setState() in componentWillUnmount().
|
|
1864
|
-
// In this case, ignore the element.
|
|
1865
|
-
return;
|
|
1866
|
-
}
|
|
1867
|
-
item.updateCount++;
|
|
1868
|
-
},
|
|
1869
|
-
onUnmountComponent: function (id) {
|
|
1870
|
-
var item = getItem(id);
|
|
1871
|
-
if (item) {
|
|
1872
|
-
// We need to check if it exists.
|
|
1873
|
-
// `item` might not exist if it is inside an error boundary, and a sibling
|
|
1874
|
-
// error boundary child threw while mounting. Then this instance never
|
|
1875
|
-
// got a chance to mount, but it still gets an unmounting event during
|
|
1876
|
-
// the error boundary cleanup.
|
|
1877
|
-
item.isMounted = false;
|
|
1878
|
-
var isRoot = item.parentID === 0;
|
|
1879
|
-
if (isRoot) {
|
|
1880
|
-
removeRoot(id);
|
|
1881
|
-
}
|
|
1882
|
-
}
|
|
1883
|
-
unmountedIDs.push(id);
|
|
1884
|
-
},
|
|
1885
|
-
purgeUnmountedComponents: function () {
|
|
1886
|
-
if (ReactComponentTreeHook._preventPurging) {
|
|
1887
|
-
// Should only be used for testing.
|
|
1888
|
-
return;
|
|
1889
|
-
}
|
|
1585
|
+
function createFactoryWithValidation(type) {
|
|
1586
|
+
var validatedFactory = createElementWithValidation.bind(null, type);
|
|
1587
|
+
// Legacy hook TODO: Warn if this is accessed
|
|
1588
|
+
validatedFactory.type = type;
|
|
1890
1589
|
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
},
|
|
1901
|
-
getCurrentStackAddendum: function () {
|
|
1902
|
-
var info = '';
|
|
1903
|
-
var currentOwner = ReactCurrentOwner_1.current;
|
|
1904
|
-
if (currentOwner) {
|
|
1905
|
-
!(typeof currentOwner.tag !== 'number') ? invariant_1(false, 'Fiber owners should not show up in Stack stack traces.') : void 0;
|
|
1906
|
-
if (typeof currentOwner._debugID === 'number') {
|
|
1907
|
-
info += ReactComponentTreeHook.getStackAddendumByID(currentOwner._debugID);
|
|
1590
|
+
{
|
|
1591
|
+
Object.defineProperty(validatedFactory, 'type', {
|
|
1592
|
+
enumerable: false,
|
|
1593
|
+
get: function () {
|
|
1594
|
+
lowPriorityWarning$1(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
|
|
1595
|
+
Object.defineProperty(this, 'type', {
|
|
1596
|
+
value: type
|
|
1597
|
+
});
|
|
1598
|
+
return type;
|
|
1908
1599
|
}
|
|
1909
|
-
}
|
|
1910
|
-
|
|
1911
|
-
},
|
|
1912
|
-
getStackAddendumByID: function (id) {
|
|
1913
|
-
var info = '';
|
|
1914
|
-
while (id) {
|
|
1915
|
-
info += describeID(id);
|
|
1916
|
-
id = ReactComponentTreeHook.getParentID(id);
|
|
1917
|
-
}
|
|
1918
|
-
return info;
|
|
1919
|
-
},
|
|
1920
|
-
getChildIDs: function (id) {
|
|
1921
|
-
var item = getItem(id);
|
|
1922
|
-
return item ? item.childIDs : [];
|
|
1923
|
-
},
|
|
1924
|
-
getDisplayName: function (id) {
|
|
1925
|
-
var element = ReactComponentTreeHook.getElement(id);
|
|
1926
|
-
if (!element) {
|
|
1927
|
-
return null;
|
|
1928
|
-
}
|
|
1929
|
-
return getDisplayName$1(element);
|
|
1930
|
-
},
|
|
1931
|
-
getElement: function (id) {
|
|
1932
|
-
var item = getItem(id);
|
|
1933
|
-
return item ? item.element : null;
|
|
1934
|
-
},
|
|
1935
|
-
getOwnerID: function (id) {
|
|
1936
|
-
var element = ReactComponentTreeHook.getElement(id);
|
|
1937
|
-
if (!element || !element._owner) {
|
|
1938
|
-
return null;
|
|
1939
|
-
}
|
|
1940
|
-
return element._owner._debugID;
|
|
1941
|
-
},
|
|
1942
|
-
getParentID: function (id) {
|
|
1943
|
-
var item = getItem(id);
|
|
1944
|
-
return item ? item.parentID : null;
|
|
1945
|
-
},
|
|
1946
|
-
getSource: function (id) {
|
|
1947
|
-
var item = getItem(id);
|
|
1948
|
-
var element = item ? item.element : null;
|
|
1949
|
-
var source = element != null ? element._source : null;
|
|
1950
|
-
return source;
|
|
1951
|
-
},
|
|
1952
|
-
getText: function (id) {
|
|
1953
|
-
var element = ReactComponentTreeHook.getElement(id);
|
|
1954
|
-
if (typeof element === 'string') {
|
|
1955
|
-
return element;
|
|
1956
|
-
} else if (typeof element === 'number') {
|
|
1957
|
-
return '' + element;
|
|
1958
|
-
} else {
|
|
1959
|
-
return null;
|
|
1960
|
-
}
|
|
1961
|
-
},
|
|
1962
|
-
getUpdateCount: function (id) {
|
|
1963
|
-
var item = getItem(id);
|
|
1964
|
-
return item ? item.updateCount : 0;
|
|
1965
|
-
},
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
getRootIDs: getRootIDs,
|
|
1969
|
-
getRegisteredIDs: getItemIDs
|
|
1970
|
-
};
|
|
1971
|
-
|
|
1972
|
-
var ReactComponentTreeHook_1 = ReactComponentTreeHook;
|
|
1600
|
+
});
|
|
1601
|
+
}
|
|
1973
1602
|
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
var cloneElement = ReactElement_1.cloneElement;
|
|
1603
|
+
return validatedFactory;
|
|
1604
|
+
}
|
|
1977
1605
|
|
|
1978
|
-
{
|
|
1979
|
-
var
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1606
|
+
function cloneElementWithValidation(element, props, children) {
|
|
1607
|
+
var newElement = cloneElement.apply(this, arguments);
|
|
1608
|
+
for (var i = 2; i < arguments.length; i++) {
|
|
1609
|
+
validateChildKeys(arguments[i], newElement.type);
|
|
1610
|
+
}
|
|
1611
|
+
validatePropTypes(newElement);
|
|
1612
|
+
return newElement;
|
|
1983
1613
|
}
|
|
1984
1614
|
|
|
1615
|
+
var REACT_FRAGMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.fragment') || 0xeacb;
|
|
1616
|
+
|
|
1985
1617
|
var React = {
|
|
1986
1618
|
Children: {
|
|
1987
|
-
map:
|
|
1988
|
-
forEach:
|
|
1989
|
-
count:
|
|
1990
|
-
toArray:
|
|
1991
|
-
only:
|
|
1619
|
+
map: mapChildren,
|
|
1620
|
+
forEach: forEachChildren,
|
|
1621
|
+
count: countChildren,
|
|
1622
|
+
toArray: toArray,
|
|
1623
|
+
only: onlyChild
|
|
1992
1624
|
},
|
|
1993
1625
|
|
|
1994
|
-
Component:
|
|
1995
|
-
PureComponent:
|
|
1996
|
-
unstable_AsyncComponent:
|
|
1626
|
+
Component: Component,
|
|
1627
|
+
PureComponent: PureComponent,
|
|
1628
|
+
unstable_AsyncComponent: AsyncComponent,
|
|
1997
1629
|
|
|
1998
|
-
createElement:
|
|
1999
|
-
cloneElement:
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
createFactory: createFactory,
|
|
1630
|
+
createElement: createElementWithValidation,
|
|
1631
|
+
cloneElement: cloneElementWithValidation,
|
|
1632
|
+
createFactory: createFactoryWithValidation,
|
|
1633
|
+
isValidElement: isValidElement,
|
|
2003
1634
|
|
|
2004
1635
|
version: ReactVersion,
|
|
2005
1636
|
|
|
2006
1637
|
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
|
|
2007
|
-
ReactCurrentOwner:
|
|
1638
|
+
ReactCurrentOwner: ReactCurrentOwner,
|
|
2008
1639
|
// Used by renderers to avoid bundling object-assign twice in UMD bundles:
|
|
2009
|
-
assign:
|
|
1640
|
+
assign: objectAssign$1
|
|
2010
1641
|
}
|
|
2011
1642
|
};
|
|
2012
1643
|
|
|
1644
|
+
if (enableReactFragment) {
|
|
1645
|
+
React.Fragment = REACT_FRAGMENT_TYPE;
|
|
1646
|
+
}
|
|
1647
|
+
|
|
2013
1648
|
{
|
|
2014
|
-
|
|
1649
|
+
objectAssign$1(React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, {
|
|
2015
1650
|
// These should not be included in production.
|
|
2016
|
-
|
|
2017
|
-
|
|
1651
|
+
ReactDebugCurrentFrame: ReactDebugCurrentFrame,
|
|
1652
|
+
// Shim for React DOM 16.0.0 which still destructured (but not used) this.
|
|
1653
|
+
// TODO: remove in React 17.0.
|
|
1654
|
+
ReactComponentTreeHook: {}
|
|
2018
1655
|
});
|
|
2019
1656
|
}
|
|
2020
1657
|
|
|
2021
|
-
var ReactEntry = React;
|
|
2022
1658
|
|
|
2023
|
-
|
|
1659
|
+
|
|
1660
|
+
var React$2 = Object.freeze({
|
|
1661
|
+
default: React
|
|
1662
|
+
});
|
|
1663
|
+
|
|
1664
|
+
var React$3 = ( React$2 && React ) || React$2;
|
|
1665
|
+
|
|
1666
|
+
// TODO: decide on the top-level export form.
|
|
1667
|
+
// This is hacky but makes it work with both Rollup and Jest.
|
|
1668
|
+
var react = React$3['default'] ? React$3['default'] : React$3;
|
|
1669
|
+
|
|
1670
|
+
return react;
|
|
2024
1671
|
|
|
2025
1672
|
})));
|