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