react-is 16.9.0-alpha.0 → 16.10.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/README.md +2 -12
- package/build-info.json +5 -5
- package/cjs/react-is.development.js +29 -24
- package/cjs/react-is.production.min.js +6 -6
- package/package.json +1 -1
- package/umd/react-is.development.js +29 -24
- package/umd/react-is.production.min.js +5 -5
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ class ClassComponent extends React.Component {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
const
|
|
29
|
+
const FunctionComponent = () => React.createElement("div");
|
|
30
30
|
|
|
31
31
|
const ForwardRefComponent = React.forwardRef((props, ref) =>
|
|
32
32
|
React.createElement(Component, { forwardedRef: ref, ...props })
|
|
@@ -36,7 +36,7 @@ const Context = React.createContext(false);
|
|
|
36
36
|
|
|
37
37
|
ReactIs.isValidElementType("div"); // true
|
|
38
38
|
ReactIs.isValidElementType(ClassComponent); // true
|
|
39
|
-
ReactIs.isValidElementType(
|
|
39
|
+
ReactIs.isValidElementType(FunctionComponent); // true
|
|
40
40
|
ReactIs.isValidElementType(ForwardRefComponent); // true
|
|
41
41
|
ReactIs.isValidElementType(Context.Provider); // true
|
|
42
42
|
ReactIs.isValidElementType(Context.Consumer); // true
|
|
@@ -45,16 +45,6 @@ ReactIs.isValidElementType(React.createFactory("div")); // true
|
|
|
45
45
|
|
|
46
46
|
### Determining an Element's Type
|
|
47
47
|
|
|
48
|
-
#### ConcurrentMode
|
|
49
|
-
|
|
50
|
-
```js
|
|
51
|
-
import React from "react";
|
|
52
|
-
import * as ReactIs from 'react-is';
|
|
53
|
-
|
|
54
|
-
ReactIs.isConcurrentMode(<React.unstable_ConcurrentMode />); // true
|
|
55
|
-
ReactIs.typeOf(<React.unstable_ConcurrentMode />) === ReactIs.ConcurrentMode; // true
|
|
56
|
-
```
|
|
57
|
-
|
|
58
48
|
#### Context
|
|
59
49
|
|
|
60
50
|
```js
|
package/build-info.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"branch": "pull/
|
|
3
|
-
"buildNumber": "
|
|
4
|
-
"checksum": "
|
|
5
|
-
"commit": "
|
|
2
|
+
"branch": "pull/16944",
|
|
3
|
+
"buildNumber": "48896",
|
|
4
|
+
"checksum": "2bf0c82",
|
|
5
|
+
"commit": "d346d9208",
|
|
6
6
|
"environment": "ci",
|
|
7
|
-
"reactVersion": "16.
|
|
7
|
+
"reactVersion": "16.9.0-canary-d346d9208"
|
|
8
8
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.
|
|
1
|
+
/** @license React v16.10.1
|
|
2
2
|
* react-is.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -20,29 +20,29 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
20
20
|
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
21
21
|
// nor polyfill, then a plain number is used for performance.
|
|
22
22
|
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
23
|
-
|
|
24
23
|
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
25
24
|
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
26
25
|
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
27
26
|
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
28
27
|
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
29
28
|
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
30
|
-
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
|
|
29
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
30
|
+
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
31
|
+
|
|
31
32
|
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
32
33
|
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
33
34
|
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
34
35
|
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
36
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
35
37
|
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
36
38
|
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
// React event targets
|
|
39
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
40
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
41
|
+
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
41
42
|
|
|
42
43
|
function isValidElementType(type) {
|
|
43
|
-
return typeof type === 'string' || typeof type === 'function' ||
|
|
44
|
-
|
|
45
|
-
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_EVENT_COMPONENT_TYPE || type.$$typeof === REACT_EVENT_TARGET_TYPE);
|
|
44
|
+
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
45
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
/**
|
|
@@ -58,12 +58,11 @@ function isValidElementType(type) {
|
|
|
58
58
|
* paths. Removing the logging code for production environments will keep the
|
|
59
59
|
* same logic and follow the same code paths.
|
|
60
60
|
*/
|
|
61
|
-
|
|
62
|
-
var lowPriorityWarning = function () {};
|
|
61
|
+
var lowPriorityWarningWithoutStack = function () {};
|
|
63
62
|
|
|
64
63
|
{
|
|
65
64
|
var printWarning = function (format) {
|
|
66
|
-
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
65
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
67
66
|
args[_key - 1] = arguments[_key];
|
|
68
67
|
}
|
|
69
68
|
|
|
@@ -71,9 +70,11 @@ var lowPriorityWarning = function () {};
|
|
|
71
70
|
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
72
71
|
return args[argIndex++];
|
|
73
72
|
});
|
|
73
|
+
|
|
74
74
|
if (typeof console !== 'undefined') {
|
|
75
75
|
console.warn(message);
|
|
76
76
|
}
|
|
77
|
+
|
|
77
78
|
try {
|
|
78
79
|
// --- Welcome to debugging React ---
|
|
79
80
|
// This error was thrown as a convenience so that you can use this stack
|
|
@@ -82,25 +83,27 @@ var lowPriorityWarning = function () {};
|
|
|
82
83
|
} catch (x) {}
|
|
83
84
|
};
|
|
84
85
|
|
|
85
|
-
|
|
86
|
+
lowPriorityWarningWithoutStack = function (condition, format) {
|
|
86
87
|
if (format === undefined) {
|
|
87
|
-
throw new Error('`
|
|
88
|
+
throw new Error('`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
|
|
88
89
|
}
|
|
90
|
+
|
|
89
91
|
if (!condition) {
|
|
90
|
-
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
92
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
91
93
|
args[_key2 - 2] = arguments[_key2];
|
|
92
94
|
}
|
|
93
95
|
|
|
94
|
-
printWarning.apply(
|
|
96
|
+
printWarning.apply(void 0, [format].concat(args));
|
|
95
97
|
}
|
|
96
98
|
};
|
|
97
99
|
}
|
|
98
100
|
|
|
99
|
-
var
|
|
101
|
+
var lowPriorityWarningWithoutStack$1 = lowPriorityWarningWithoutStack;
|
|
100
102
|
|
|
101
103
|
function typeOf(object) {
|
|
102
104
|
if (typeof object === 'object' && object !== null) {
|
|
103
105
|
var $$typeof = object.$$typeof;
|
|
106
|
+
|
|
104
107
|
switch ($$typeof) {
|
|
105
108
|
case REACT_ELEMENT_TYPE:
|
|
106
109
|
var type = object.type;
|
|
@@ -113,6 +116,7 @@ function typeOf(object) {
|
|
|
113
116
|
case REACT_STRICT_MODE_TYPE:
|
|
114
117
|
case REACT_SUSPENSE_TYPE:
|
|
115
118
|
return type;
|
|
119
|
+
|
|
116
120
|
default:
|
|
117
121
|
var $$typeofType = type && type.$$typeof;
|
|
118
122
|
|
|
@@ -121,10 +125,13 @@ function typeOf(object) {
|
|
|
121
125
|
case REACT_FORWARD_REF_TYPE:
|
|
122
126
|
case REACT_PROVIDER_TYPE:
|
|
123
127
|
return $$typeofType;
|
|
128
|
+
|
|
124
129
|
default:
|
|
125
130
|
return $$typeof;
|
|
126
131
|
}
|
|
132
|
+
|
|
127
133
|
}
|
|
134
|
+
|
|
128
135
|
case REACT_LAZY_TYPE:
|
|
129
136
|
case REACT_MEMO_TYPE:
|
|
130
137
|
case REACT_PORTAL_TYPE:
|
|
@@ -133,9 +140,8 @@ function typeOf(object) {
|
|
|
133
140
|
}
|
|
134
141
|
|
|
135
142
|
return undefined;
|
|
136
|
-
}
|
|
143
|
+
} // AsyncMode is deprecated along with isAsyncMode
|
|
137
144
|
|
|
138
|
-
// AsyncMode is deprecated along with isAsyncMode
|
|
139
145
|
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
140
146
|
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
141
147
|
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
@@ -149,17 +155,16 @@ var Portal = REACT_PORTAL_TYPE;
|
|
|
149
155
|
var Profiler = REACT_PROFILER_TYPE;
|
|
150
156
|
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
151
157
|
var Suspense = REACT_SUSPENSE_TYPE;
|
|
158
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
|
|
152
159
|
|
|
153
|
-
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
154
|
-
|
|
155
|
-
// AsyncMode should be deprecated
|
|
156
160
|
function isAsyncMode(object) {
|
|
157
161
|
{
|
|
158
162
|
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
159
163
|
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
160
|
-
|
|
164
|
+
lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
|
161
165
|
}
|
|
162
166
|
}
|
|
167
|
+
|
|
163
168
|
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
164
169
|
}
|
|
165
170
|
function isConcurrentMode(object) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.
|
|
1
|
+
/** @license React v16.10.1
|
|
2
2
|
* react-is.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';Object.defineProperty(exports,"__esModule",{value:!0});
|
|
11
|
-
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.
|
|
12
|
-
|
|
13
|
-
exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=
|
|
14
|
-
exports.
|
|
15
|
-
exports.isPortal=function(a){return
|
|
11
|
+
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.suspense_list"):
|
|
12
|
+
60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.fundamental"):60117,w=b?Symbol.for("react.responder"):60118,x=b?Symbol.for("react.scope"):60119;function y(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case h:return a;default:return u}}case t:case r:case d:return u}}}function z(a){return y(a)===m}
|
|
13
|
+
exports.typeOf=y;exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;
|
|
14
|
+
exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===v||a.$$typeof===w||a.$$typeof===x)};exports.isAsyncMode=function(a){return z(a)||y(a)===l};exports.isConcurrentMode=z;exports.isContextConsumer=function(a){return y(a)===k};exports.isContextProvider=function(a){return y(a)===h};
|
|
15
|
+
exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return y(a)===n};exports.isFragment=function(a){return y(a)===e};exports.isLazy=function(a){return y(a)===t};exports.isMemo=function(a){return y(a)===r};exports.isPortal=function(a){return y(a)===d};exports.isProfiler=function(a){return y(a)===g};exports.isStrictMode=function(a){return y(a)===f};exports.isSuspense=function(a){return y(a)===p};
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.
|
|
1
|
+
/** @license React v16.10.1
|
|
2
2
|
* react-is.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -18,29 +18,29 @@
|
|
|
18
18
|
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
19
19
|
// nor polyfill, then a plain number is used for performance.
|
|
20
20
|
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
21
|
-
|
|
22
21
|
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
23
22
|
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
24
23
|
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
25
24
|
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
26
25
|
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
27
26
|
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
28
|
-
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
|
|
27
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
28
|
+
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
29
|
+
|
|
29
30
|
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
30
31
|
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
31
32
|
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
32
33
|
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
34
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
33
35
|
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
34
36
|
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
// React event targets
|
|
37
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
38
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
39
|
+
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
39
40
|
|
|
40
41
|
function isValidElementType(type) {
|
|
41
|
-
return typeof type === 'string' || typeof type === 'function' ||
|
|
42
|
-
|
|
43
|
-
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_EVENT_COMPONENT_TYPE || type.$$typeof === REACT_EVENT_TARGET_TYPE);
|
|
42
|
+
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
43
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
/**
|
|
@@ -56,12 +56,11 @@ function isValidElementType(type) {
|
|
|
56
56
|
* paths. Removing the logging code for production environments will keep the
|
|
57
57
|
* same logic and follow the same code paths.
|
|
58
58
|
*/
|
|
59
|
-
|
|
60
|
-
var lowPriorityWarning = function () {};
|
|
59
|
+
var lowPriorityWarningWithoutStack = function () {};
|
|
61
60
|
|
|
62
61
|
{
|
|
63
62
|
var printWarning = function (format) {
|
|
64
|
-
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
63
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
65
64
|
args[_key - 1] = arguments[_key];
|
|
66
65
|
}
|
|
67
66
|
|
|
@@ -69,9 +68,11 @@ var lowPriorityWarning = function () {};
|
|
|
69
68
|
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
70
69
|
return args[argIndex++];
|
|
71
70
|
});
|
|
71
|
+
|
|
72
72
|
if (typeof console !== 'undefined') {
|
|
73
73
|
console.warn(message);
|
|
74
74
|
}
|
|
75
|
+
|
|
75
76
|
try {
|
|
76
77
|
// --- Welcome to debugging React ---
|
|
77
78
|
// This error was thrown as a convenience so that you can use this stack
|
|
@@ -80,25 +81,27 @@ var lowPriorityWarning = function () {};
|
|
|
80
81
|
} catch (x) {}
|
|
81
82
|
};
|
|
82
83
|
|
|
83
|
-
|
|
84
|
+
lowPriorityWarningWithoutStack = function (condition, format) {
|
|
84
85
|
if (format === undefined) {
|
|
85
|
-
throw new Error('`
|
|
86
|
+
throw new Error('`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
|
|
86
87
|
}
|
|
88
|
+
|
|
87
89
|
if (!condition) {
|
|
88
|
-
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
90
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
89
91
|
args[_key2 - 2] = arguments[_key2];
|
|
90
92
|
}
|
|
91
93
|
|
|
92
|
-
printWarning.apply(
|
|
94
|
+
printWarning.apply(void 0, [format].concat(args));
|
|
93
95
|
}
|
|
94
96
|
};
|
|
95
97
|
}
|
|
96
98
|
|
|
97
|
-
var
|
|
99
|
+
var lowPriorityWarningWithoutStack$1 = lowPriorityWarningWithoutStack;
|
|
98
100
|
|
|
99
101
|
function typeOf(object) {
|
|
100
102
|
if (typeof object === 'object' && object !== null) {
|
|
101
103
|
var $$typeof = object.$$typeof;
|
|
104
|
+
|
|
102
105
|
switch ($$typeof) {
|
|
103
106
|
case REACT_ELEMENT_TYPE:
|
|
104
107
|
var type = object.type;
|
|
@@ -111,6 +114,7 @@ function typeOf(object) {
|
|
|
111
114
|
case REACT_STRICT_MODE_TYPE:
|
|
112
115
|
case REACT_SUSPENSE_TYPE:
|
|
113
116
|
return type;
|
|
117
|
+
|
|
114
118
|
default:
|
|
115
119
|
var $$typeofType = type && type.$$typeof;
|
|
116
120
|
|
|
@@ -119,10 +123,13 @@ function typeOf(object) {
|
|
|
119
123
|
case REACT_FORWARD_REF_TYPE:
|
|
120
124
|
case REACT_PROVIDER_TYPE:
|
|
121
125
|
return $$typeofType;
|
|
126
|
+
|
|
122
127
|
default:
|
|
123
128
|
return $$typeof;
|
|
124
129
|
}
|
|
130
|
+
|
|
125
131
|
}
|
|
132
|
+
|
|
126
133
|
case REACT_LAZY_TYPE:
|
|
127
134
|
case REACT_MEMO_TYPE:
|
|
128
135
|
case REACT_PORTAL_TYPE:
|
|
@@ -131,9 +138,8 @@ function typeOf(object) {
|
|
|
131
138
|
}
|
|
132
139
|
|
|
133
140
|
return undefined;
|
|
134
|
-
}
|
|
141
|
+
} // AsyncMode is deprecated along with isAsyncMode
|
|
135
142
|
|
|
136
|
-
// AsyncMode is deprecated along with isAsyncMode
|
|
137
143
|
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
138
144
|
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
139
145
|
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
@@ -147,17 +153,16 @@ var Portal = REACT_PORTAL_TYPE;
|
|
|
147
153
|
var Profiler = REACT_PROFILER_TYPE;
|
|
148
154
|
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
149
155
|
var Suspense = REACT_SUSPENSE_TYPE;
|
|
156
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
|
|
150
157
|
|
|
151
|
-
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
152
|
-
|
|
153
|
-
// AsyncMode should be deprecated
|
|
154
158
|
function isAsyncMode(object) {
|
|
155
159
|
{
|
|
156
160
|
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
157
161
|
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
158
|
-
|
|
162
|
+
lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
|
159
163
|
}
|
|
160
164
|
}
|
|
165
|
+
|
|
161
166
|
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
162
167
|
}
|
|
163
168
|
function isConcurrentMode(object) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.
|
|
1
|
+
/** @license React v16.10.1
|
|
2
2
|
* react-is.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
9
|
'use strict';(function(b,c){"object"===typeof exports&&"undefined"!==typeof module?c(exports):"function"===typeof define&&define.amd?define(["exports"],c):c(b.ReactIs={})})(this,function(b){function c(a){if("object"===typeof a&&null!==a){var b=a.$$typeof;switch(b){case r:switch(a=a.type,a){case t:case e:case f:case g:case h:case k:return a;default:switch(a=a&&a.$$typeof,a){case l:case m:case n:return a;default:return b}}case p:case q:case u:return b}}}function v(a){return c(a)===e}var d="function"===
|
|
10
|
-
typeof Symbol&&Symbol.for,r=d?Symbol.for("react.element"):60103,u=d?Symbol.for("react.portal"):60106,f=d?Symbol.for("react.fragment"):60107,h=d?Symbol.for("react.strict_mode"):60108,g=d?Symbol.for("react.profiler"):60114,n=d?Symbol.for("react.provider"):60109,l=d?Symbol.for("react.context"):60110,t=d?Symbol.for("react.async_mode"):60111,e=d?Symbol.for("react.concurrent_mode"):60111,m=d?Symbol.for("react.forward_ref"):60112,k=d?Symbol.for("react.suspense"):60113,
|
|
11
|
-
p=d?Symbol.for("react.lazy"):60116,
|
|
12
|
-
n||a.$$typeof===l||a.$$typeof===m||a.$$typeof===
|
|
13
|
-
u};b.isProfiler=function(a){return c(a)===g};b.isStrictMode=function(a){return c(a)===h};b.isSuspense=function(a){return c(a)===k};Object.defineProperty(b,"__esModule",{value:!0})});
|
|
10
|
+
typeof Symbol&&Symbol.for,r=d?Symbol.for("react.element"):60103,u=d?Symbol.for("react.portal"):60106,f=d?Symbol.for("react.fragment"):60107,h=d?Symbol.for("react.strict_mode"):60108,g=d?Symbol.for("react.profiler"):60114,n=d?Symbol.for("react.provider"):60109,l=d?Symbol.for("react.context"):60110,t=d?Symbol.for("react.async_mode"):60111,e=d?Symbol.for("react.concurrent_mode"):60111,m=d?Symbol.for("react.forward_ref"):60112,k=d?Symbol.for("react.suspense"):60113,w=d?Symbol.for("react.suspense_list"):
|
|
11
|
+
60120,q=d?Symbol.for("react.memo"):60115,p=d?Symbol.for("react.lazy"):60116,x=d?Symbol.for("react.fundamental"):60117,y=d?Symbol.for("react.responder"):60118,z=d?Symbol.for("react.scope"):60119;b.typeOf=c;b.AsyncMode=t;b.ConcurrentMode=e;b.ContextConsumer=l;b.ContextProvider=n;b.Element=r;b.ForwardRef=m;b.Fragment=f;b.Lazy=p;b.Memo=q;b.Portal=u;b.Profiler=g;b.StrictMode=h;b.Suspense=k;b.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===f||a===e||a===g||a===h||a===
|
|
12
|
+
k||a===w||"object"===typeof a&&null!==a&&(a.$$typeof===p||a.$$typeof===q||a.$$typeof===n||a.$$typeof===l||a.$$typeof===m||a.$$typeof===x||a.$$typeof===y||a.$$typeof===z)};b.isAsyncMode=function(a){return v(a)||c(a)===t};b.isConcurrentMode=v;b.isContextConsumer=function(a){return c(a)===l};b.isContextProvider=function(a){return c(a)===n};b.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===r};b.isForwardRef=function(a){return c(a)===m};b.isFragment=function(a){return c(a)===f};
|
|
13
|
+
b.isLazy=function(a){return c(a)===p};b.isMemo=function(a){return c(a)===q};b.isPortal=function(a){return c(a)===u};b.isProfiler=function(a){return c(a)===g};b.isStrictMode=function(a){return c(a)===h};b.isSuspense=function(a){return c(a)===k};Object.defineProperty(b,"__esModule",{value:!0})});
|