react-is 18.3.0 → 19.0.0-beta-94eed63c49-20240425
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 +1 -1
- package/README.md +0 -1
- package/cjs/react-is.development.js +39 -60
- package/cjs/react-is.production.js +130 -0
- package/index.js +1 -1
- package/package.json +4 -4
- package/cjs/react-is.production.min.js +0 -14
- package/umd/react-is.development.js +0 -220
- package/umd/react-is.production.min.js +0 -15
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -40,7 +40,6 @@ ReactIs.isValidElementType(FunctionComponent); // true
|
|
|
40
40
|
ReactIs.isValidElementType(ForwardRefComponent); // true
|
|
41
41
|
ReactIs.isValidElementType(Context.Provider); // true
|
|
42
42
|
ReactIs.isValidElementType(Context.Consumer); // true
|
|
43
|
-
ReactIs.isValidElementType(React.createFactory("div")); // true
|
|
44
43
|
```
|
|
45
44
|
|
|
46
45
|
### Determining an Element's Type
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @license React
|
|
3
3
|
* react-is.development.js
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -14,59 +14,52 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
14
14
|
(function() {
|
|
15
15
|
'use strict';
|
|
16
16
|
|
|
17
|
-
// ATTENTION
|
|
18
|
-
// When adding new symbols to this file,
|
|
19
|
-
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
20
|
-
// The Symbol used to tag the ReactElement-like types.
|
|
21
|
-
var REACT_ELEMENT_TYPE = Symbol.for('react.element');
|
|
22
|
-
var REACT_PORTAL_TYPE = Symbol.for('react.portal');
|
|
23
|
-
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
|
24
|
-
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
|
|
25
|
-
var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
|
|
26
|
-
var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
|
|
27
|
-
var REACT_CONTEXT_TYPE = Symbol.for('react.context');
|
|
28
|
-
var REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context');
|
|
29
|
-
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
|
30
|
-
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
|
31
|
-
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
|
32
|
-
var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
|
33
|
-
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
|
34
|
-
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
|
|
35
|
-
|
|
36
17
|
// -----------------------------------------------------------------------------
|
|
37
18
|
|
|
38
19
|
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
39
|
-
var enableCacheElement = false;
|
|
40
20
|
var enableTransitionTracing = false; // No known bugs, but needs performance testing
|
|
41
21
|
|
|
42
22
|
var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
|
|
23
|
+
|
|
24
|
+
var enableRenderableContext = true; // Enables the `initialValue` option for `useDeferredValue`
|
|
43
25
|
// stuff. Intended to enable React core members to more easily debug scheduling
|
|
44
26
|
// issues in DEV builds.
|
|
45
27
|
|
|
46
|
-
var enableDebugTracing = false;
|
|
28
|
+
var enableDebugTracing = false;
|
|
47
29
|
|
|
48
|
-
var
|
|
30
|
+
var REACT_ELEMENT_TYPE = Symbol.for('react.transitional.element') ;
|
|
31
|
+
var REACT_PORTAL_TYPE = Symbol.for('react.portal');
|
|
32
|
+
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
|
33
|
+
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
|
|
34
|
+
var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
|
|
35
|
+
var REACT_PROVIDER_TYPE = Symbol.for('react.provider'); // TODO: Delete with enableRenderableContext
|
|
49
36
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
37
|
+
var REACT_CONSUMER_TYPE = Symbol.for('react.consumer');
|
|
38
|
+
var REACT_CONTEXT_TYPE = Symbol.for('react.context');
|
|
39
|
+
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
|
40
|
+
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
|
41
|
+
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
|
42
|
+
var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
|
43
|
+
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
|
44
|
+
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
|
|
53
45
|
|
|
46
|
+
var REACT_CLIENT_REFERENCE = Symbol.for('react.client.reference');
|
|
54
47
|
function isValidElementType(type) {
|
|
55
48
|
if (typeof type === 'string' || typeof type === 'function') {
|
|
56
49
|
return true;
|
|
57
50
|
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
58
51
|
|
|
59
52
|
|
|
60
|
-
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI ||
|
|
53
|
+
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableTransitionTracing ) {
|
|
61
54
|
return true;
|
|
62
55
|
}
|
|
63
56
|
|
|
64
57
|
if (typeof type === 'object' && type !== null) {
|
|
65
|
-
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof ===
|
|
58
|
+
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || !enableRenderableContext || type.$$typeof === REACT_CONSUMER_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
|
|
66
59
|
// types supported by any Flight configuration anywhere since
|
|
67
60
|
// we don't know which Flight build this will end up being used
|
|
68
61
|
// with.
|
|
69
|
-
type.$$typeof ===
|
|
62
|
+
type.$$typeof === REACT_CLIENT_REFERENCE || type.getModuleId !== undefined) {
|
|
70
63
|
return true;
|
|
71
64
|
}
|
|
72
65
|
}
|
|
@@ -94,14 +87,23 @@ function typeOf(object) {
|
|
|
94
87
|
var $$typeofType = type && type.$$typeof;
|
|
95
88
|
|
|
96
89
|
switch ($$typeofType) {
|
|
97
|
-
case REACT_SERVER_CONTEXT_TYPE:
|
|
98
90
|
case REACT_CONTEXT_TYPE:
|
|
99
91
|
case REACT_FORWARD_REF_TYPE:
|
|
100
92
|
case REACT_LAZY_TYPE:
|
|
101
93
|
case REACT_MEMO_TYPE:
|
|
102
|
-
case REACT_PROVIDER_TYPE:
|
|
103
94
|
return $$typeofType;
|
|
104
95
|
|
|
96
|
+
case REACT_CONSUMER_TYPE:
|
|
97
|
+
{
|
|
98
|
+
return $$typeofType;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Fall through
|
|
102
|
+
|
|
103
|
+
case REACT_PROVIDER_TYPE:
|
|
104
|
+
|
|
105
|
+
// Fall through
|
|
106
|
+
|
|
105
107
|
default:
|
|
106
108
|
return $$typeof;
|
|
107
109
|
}
|
|
@@ -115,8 +117,8 @@ function typeOf(object) {
|
|
|
115
117
|
|
|
116
118
|
return undefined;
|
|
117
119
|
}
|
|
118
|
-
var ContextConsumer =
|
|
119
|
-
var ContextProvider =
|
|
120
|
+
var ContextConsumer = REACT_CONSUMER_TYPE ;
|
|
121
|
+
var ContextProvider = REACT_CONTEXT_TYPE ;
|
|
120
122
|
var Element = REACT_ELEMENT_TYPE;
|
|
121
123
|
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
122
124
|
var Fragment = REACT_FRAGMENT_TYPE;
|
|
@@ -127,36 +129,15 @@ var Profiler = REACT_PROFILER_TYPE;
|
|
|
127
129
|
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
128
130
|
var Suspense = REACT_SUSPENSE_TYPE;
|
|
129
131
|
var SuspenseList = REACT_SUSPENSE_LIST_TYPE;
|
|
130
|
-
|
|
131
|
-
var hasWarnedAboutDeprecatedIsConcurrentMode = false; // AsyncMode should be deprecated
|
|
132
|
-
|
|
133
|
-
function isAsyncMode(object) {
|
|
132
|
+
function isContextConsumer(object) {
|
|
134
133
|
{
|
|
135
|
-
|
|
136
|
-
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
137
|
-
|
|
138
|
-
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
|
|
139
|
-
}
|
|
134
|
+
return typeOf(object) === REACT_CONSUMER_TYPE;
|
|
140
135
|
}
|
|
141
|
-
|
|
142
|
-
return false;
|
|
143
136
|
}
|
|
144
|
-
function
|
|
137
|
+
function isContextProvider(object) {
|
|
145
138
|
{
|
|
146
|
-
|
|
147
|
-
hasWarnedAboutDeprecatedIsConcurrentMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
148
|
-
|
|
149
|
-
console['warn']('The ReactIs.isConcurrentMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
|
|
150
|
-
}
|
|
139
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
151
140
|
}
|
|
152
|
-
|
|
153
|
-
return false;
|
|
154
|
-
}
|
|
155
|
-
function isContextConsumer(object) {
|
|
156
|
-
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
157
|
-
}
|
|
158
|
-
function isContextProvider(object) {
|
|
159
|
-
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
160
141
|
}
|
|
161
142
|
function isElement(object) {
|
|
162
143
|
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
@@ -201,8 +182,6 @@ exports.Profiler = Profiler;
|
|
|
201
182
|
exports.StrictMode = StrictMode;
|
|
202
183
|
exports.Suspense = Suspense;
|
|
203
184
|
exports.SuspenseList = SuspenseList;
|
|
204
|
-
exports.isAsyncMode = isAsyncMode;
|
|
205
|
-
exports.isConcurrentMode = isConcurrentMode;
|
|
206
185
|
exports.isContextConsumer = isContextConsumer;
|
|
207
186
|
exports.isContextProvider = isContextProvider;
|
|
208
187
|
exports.isElement = isElement;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-is.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
"use strict";
|
|
12
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
|
13
|
+
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
|
|
14
|
+
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
|
|
15
|
+
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
|
|
16
|
+
REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
17
|
+
Symbol.for("react.provider");
|
|
18
|
+
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
|
|
19
|
+
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
|
|
20
|
+
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
|
|
21
|
+
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
|
|
22
|
+
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
|
|
23
|
+
REACT_MEMO_TYPE = Symbol.for("react.memo"),
|
|
24
|
+
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
|
|
25
|
+
REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"),
|
|
26
|
+
REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
|
|
27
|
+
function typeOf(object) {
|
|
28
|
+
if ("object" === typeof object && null !== object) {
|
|
29
|
+
var $$typeof = object.$$typeof;
|
|
30
|
+
switch ($$typeof) {
|
|
31
|
+
case REACT_ELEMENT_TYPE:
|
|
32
|
+
switch (((object = object.type), object)) {
|
|
33
|
+
case REACT_FRAGMENT_TYPE:
|
|
34
|
+
case REACT_PROFILER_TYPE:
|
|
35
|
+
case REACT_STRICT_MODE_TYPE:
|
|
36
|
+
case REACT_SUSPENSE_TYPE:
|
|
37
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
38
|
+
return object;
|
|
39
|
+
default:
|
|
40
|
+
switch (((object = object && object.$$typeof), object)) {
|
|
41
|
+
case REACT_CONTEXT_TYPE:
|
|
42
|
+
case REACT_FORWARD_REF_TYPE:
|
|
43
|
+
case REACT_LAZY_TYPE:
|
|
44
|
+
case REACT_MEMO_TYPE:
|
|
45
|
+
return object;
|
|
46
|
+
case REACT_CONSUMER_TYPE:
|
|
47
|
+
return object;
|
|
48
|
+
default:
|
|
49
|
+
return $$typeof;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
case REACT_PORTAL_TYPE:
|
|
53
|
+
return $$typeof;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.ContextConsumer = REACT_CONSUMER_TYPE;
|
|
58
|
+
exports.ContextProvider = REACT_CONTEXT_TYPE;
|
|
59
|
+
exports.Element = REACT_ELEMENT_TYPE;
|
|
60
|
+
exports.ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
61
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
62
|
+
exports.Lazy = REACT_LAZY_TYPE;
|
|
63
|
+
exports.Memo = REACT_MEMO_TYPE;
|
|
64
|
+
exports.Portal = REACT_PORTAL_TYPE;
|
|
65
|
+
exports.Profiler = REACT_PROFILER_TYPE;
|
|
66
|
+
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
67
|
+
exports.Suspense = REACT_SUSPENSE_TYPE;
|
|
68
|
+
exports.SuspenseList = REACT_SUSPENSE_LIST_TYPE;
|
|
69
|
+
exports.isContextConsumer = function (object) {
|
|
70
|
+
return typeOf(object) === REACT_CONSUMER_TYPE;
|
|
71
|
+
};
|
|
72
|
+
exports.isContextProvider = function (object) {
|
|
73
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
74
|
+
};
|
|
75
|
+
exports.isElement = function (object) {
|
|
76
|
+
return (
|
|
77
|
+
"object" === typeof object &&
|
|
78
|
+
null !== object &&
|
|
79
|
+
object.$$typeof === REACT_ELEMENT_TYPE
|
|
80
|
+
);
|
|
81
|
+
};
|
|
82
|
+
exports.isForwardRef = function (object) {
|
|
83
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
84
|
+
};
|
|
85
|
+
exports.isFragment = function (object) {
|
|
86
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
87
|
+
};
|
|
88
|
+
exports.isLazy = function (object) {
|
|
89
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
90
|
+
};
|
|
91
|
+
exports.isMemo = function (object) {
|
|
92
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
93
|
+
};
|
|
94
|
+
exports.isPortal = function (object) {
|
|
95
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
96
|
+
};
|
|
97
|
+
exports.isProfiler = function (object) {
|
|
98
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
99
|
+
};
|
|
100
|
+
exports.isStrictMode = function (object) {
|
|
101
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
102
|
+
};
|
|
103
|
+
exports.isSuspense = function (object) {
|
|
104
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
105
|
+
};
|
|
106
|
+
exports.isSuspenseList = function (object) {
|
|
107
|
+
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
|
|
108
|
+
};
|
|
109
|
+
exports.isValidElementType = function (type) {
|
|
110
|
+
return "string" === typeof type ||
|
|
111
|
+
"function" === typeof type ||
|
|
112
|
+
type === REACT_FRAGMENT_TYPE ||
|
|
113
|
+
type === REACT_PROFILER_TYPE ||
|
|
114
|
+
type === REACT_STRICT_MODE_TYPE ||
|
|
115
|
+
type === REACT_SUSPENSE_TYPE ||
|
|
116
|
+
type === REACT_SUSPENSE_LIST_TYPE ||
|
|
117
|
+
type === REACT_OFFSCREEN_TYPE ||
|
|
118
|
+
("object" === typeof type &&
|
|
119
|
+
null !== type &&
|
|
120
|
+
(type.$$typeof === REACT_LAZY_TYPE ||
|
|
121
|
+
type.$$typeof === REACT_MEMO_TYPE ||
|
|
122
|
+
type.$$typeof === REACT_CONTEXT_TYPE ||
|
|
123
|
+
type.$$typeof === REACT_CONSUMER_TYPE ||
|
|
124
|
+
type.$$typeof === REACT_FORWARD_REF_TYPE ||
|
|
125
|
+
type.$$typeof === REACT_CLIENT_REFERENCE ||
|
|
126
|
+
void 0 !== type.getModuleId))
|
|
127
|
+
? !0
|
|
128
|
+
: !1;
|
|
129
|
+
};
|
|
130
|
+
exports.typeOf = typeOf;
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-is",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "19.0.0-beta-94eed63c49-20240425",
|
|
4
4
|
"description": "Brand checking of React Elements.",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"sideEffects": false,
|
|
6
7
|
"repository": {
|
|
7
8
|
"type": "git",
|
|
8
9
|
"url": "https://github.com/facebook/react.git",
|
|
@@ -15,12 +16,11 @@
|
|
|
15
16
|
"bugs": {
|
|
16
17
|
"url": "https://github.com/facebook/react/issues"
|
|
17
18
|
},
|
|
18
|
-
"homepage": "https://
|
|
19
|
+
"homepage": "https://react.dev/",
|
|
19
20
|
"files": [
|
|
20
21
|
"LICENSE",
|
|
21
22
|
"README.md",
|
|
22
23
|
"index.js",
|
|
23
|
-
"cjs/"
|
|
24
|
-
"umd/"
|
|
24
|
+
"cjs/"
|
|
25
25
|
]
|
|
26
26
|
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-is.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/
|
|
10
|
-
'use strict';var b=Symbol.for("react.element"),c=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),e=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),h=Symbol.for("react.context"),k=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),n=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),t=Symbol.for("react.offscreen"),u;u=Symbol.for("react.module.reference");
|
|
11
|
-
function v(a){if("object"===typeof a&&null!==a){var r=a.$$typeof;switch(r){case b:switch(a=a.type,a){case d:case f:case e:case m:case n:return a;default:switch(a=a&&a.$$typeof,a){case k:case h:case l:case q:case p:case g:return a;default:return r}}case c:return r}}}exports.ContextConsumer=h;exports.ContextProvider=g;exports.Element=b;exports.ForwardRef=l;exports.Fragment=d;exports.Lazy=q;exports.Memo=p;exports.Portal=c;exports.Profiler=f;exports.StrictMode=e;exports.Suspense=m;
|
|
12
|
-
exports.SuspenseList=n;exports.isAsyncMode=function(){return!1};exports.isConcurrentMode=function(){return!1};exports.isContextConsumer=function(a){return v(a)===h};exports.isContextProvider=function(a){return v(a)===g};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===b};exports.isForwardRef=function(a){return v(a)===l};exports.isFragment=function(a){return v(a)===d};exports.isLazy=function(a){return v(a)===q};exports.isMemo=function(a){return v(a)===p};
|
|
13
|
-
exports.isPortal=function(a){return v(a)===c};exports.isProfiler=function(a){return v(a)===f};exports.isStrictMode=function(a){return v(a)===e};exports.isSuspense=function(a){return v(a)===m};exports.isSuspenseList=function(a){return v(a)===n};
|
|
14
|
-
exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===d||a===f||a===e||a===m||a===n||a===t||"object"===typeof a&&null!==a&&(a.$$typeof===q||a.$$typeof===p||a.$$typeof===g||a.$$typeof===h||a.$$typeof===l||a.$$typeof===u||void 0!==a.getModuleId)?!0:!1};exports.typeOf=v;
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-is.development.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/
|
|
10
|
-
(function (global, factory) {
|
|
11
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
12
|
-
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
13
|
-
(global = global || self, factory(global.ReactIs = {}));
|
|
14
|
-
}(this, (function (exports) { 'use strict';
|
|
15
|
-
|
|
16
|
-
// ATTENTION
|
|
17
|
-
// When adding new symbols to this file,
|
|
18
|
-
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
19
|
-
// The Symbol used to tag the ReactElement-like types.
|
|
20
|
-
var REACT_ELEMENT_TYPE = Symbol.for('react.element');
|
|
21
|
-
var REACT_PORTAL_TYPE = Symbol.for('react.portal');
|
|
22
|
-
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
|
23
|
-
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
|
|
24
|
-
var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
|
|
25
|
-
var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
|
|
26
|
-
var REACT_CONTEXT_TYPE = Symbol.for('react.context');
|
|
27
|
-
var REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context');
|
|
28
|
-
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
|
29
|
-
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
|
30
|
-
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
|
31
|
-
var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
|
32
|
-
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
|
33
|
-
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
|
|
34
|
-
|
|
35
|
-
// -----------------------------------------------------------------------------
|
|
36
|
-
|
|
37
|
-
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
38
|
-
var enableCacheElement = false;
|
|
39
|
-
var enableTransitionTracing = false; // No known bugs, but needs performance testing
|
|
40
|
-
|
|
41
|
-
var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
|
|
42
|
-
// stuff. Intended to enable React core members to more easily debug scheduling
|
|
43
|
-
// issues in DEV builds.
|
|
44
|
-
|
|
45
|
-
var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
|
|
46
|
-
|
|
47
|
-
var REACT_MODULE_REFERENCE;
|
|
48
|
-
|
|
49
|
-
{
|
|
50
|
-
REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function isValidElementType(type) {
|
|
54
|
-
if (typeof type === 'string' || typeof type === 'function') {
|
|
55
|
-
return true;
|
|
56
|
-
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {
|
|
60
|
-
return true;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (typeof type === 'object' && type !== null) {
|
|
64
|
-
if (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 || // This needs to include all possible module reference object
|
|
65
|
-
// types supported by any Flight configuration anywhere since
|
|
66
|
-
// we don't know which Flight build this will end up being used
|
|
67
|
-
// with.
|
|
68
|
-
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
|
|
69
|
-
return true;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function typeOf(object) {
|
|
77
|
-
if (typeof object === 'object' && object !== null) {
|
|
78
|
-
var $$typeof = object.$$typeof;
|
|
79
|
-
|
|
80
|
-
switch ($$typeof) {
|
|
81
|
-
case REACT_ELEMENT_TYPE:
|
|
82
|
-
var type = object.type;
|
|
83
|
-
|
|
84
|
-
switch (type) {
|
|
85
|
-
case REACT_FRAGMENT_TYPE:
|
|
86
|
-
case REACT_PROFILER_TYPE:
|
|
87
|
-
case REACT_STRICT_MODE_TYPE:
|
|
88
|
-
case REACT_SUSPENSE_TYPE:
|
|
89
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
90
|
-
return type;
|
|
91
|
-
|
|
92
|
-
default:
|
|
93
|
-
var $$typeofType = type && type.$$typeof;
|
|
94
|
-
|
|
95
|
-
switch ($$typeofType) {
|
|
96
|
-
case REACT_SERVER_CONTEXT_TYPE:
|
|
97
|
-
case REACT_CONTEXT_TYPE:
|
|
98
|
-
case REACT_FORWARD_REF_TYPE:
|
|
99
|
-
case REACT_LAZY_TYPE:
|
|
100
|
-
case REACT_MEMO_TYPE:
|
|
101
|
-
case REACT_PROVIDER_TYPE:
|
|
102
|
-
return $$typeofType;
|
|
103
|
-
|
|
104
|
-
default:
|
|
105
|
-
return $$typeof;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
case REACT_PORTAL_TYPE:
|
|
111
|
-
return $$typeof;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
return undefined;
|
|
116
|
-
}
|
|
117
|
-
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
118
|
-
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
119
|
-
var Element = REACT_ELEMENT_TYPE;
|
|
120
|
-
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
121
|
-
var Fragment = REACT_FRAGMENT_TYPE;
|
|
122
|
-
var Lazy = REACT_LAZY_TYPE;
|
|
123
|
-
var Memo = REACT_MEMO_TYPE;
|
|
124
|
-
var Portal = REACT_PORTAL_TYPE;
|
|
125
|
-
var Profiler = REACT_PROFILER_TYPE;
|
|
126
|
-
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
127
|
-
var Suspense = REACT_SUSPENSE_TYPE;
|
|
128
|
-
var SuspenseList = REACT_SUSPENSE_LIST_TYPE;
|
|
129
|
-
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
130
|
-
var hasWarnedAboutDeprecatedIsConcurrentMode = false; // AsyncMode should be deprecated
|
|
131
|
-
|
|
132
|
-
function isAsyncMode(object) {
|
|
133
|
-
{
|
|
134
|
-
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
135
|
-
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
136
|
-
|
|
137
|
-
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
return false;
|
|
142
|
-
}
|
|
143
|
-
function isConcurrentMode(object) {
|
|
144
|
-
{
|
|
145
|
-
if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
|
|
146
|
-
hasWarnedAboutDeprecatedIsConcurrentMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
147
|
-
|
|
148
|
-
console['warn']('The ReactIs.isConcurrentMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
return false;
|
|
153
|
-
}
|
|
154
|
-
function isContextConsumer(object) {
|
|
155
|
-
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
156
|
-
}
|
|
157
|
-
function isContextProvider(object) {
|
|
158
|
-
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
159
|
-
}
|
|
160
|
-
function isElement(object) {
|
|
161
|
-
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
162
|
-
}
|
|
163
|
-
function isForwardRef(object) {
|
|
164
|
-
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
165
|
-
}
|
|
166
|
-
function isFragment(object) {
|
|
167
|
-
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
168
|
-
}
|
|
169
|
-
function isLazy(object) {
|
|
170
|
-
return typeOf(object) === REACT_LAZY_TYPE;
|
|
171
|
-
}
|
|
172
|
-
function isMemo(object) {
|
|
173
|
-
return typeOf(object) === REACT_MEMO_TYPE;
|
|
174
|
-
}
|
|
175
|
-
function isPortal(object) {
|
|
176
|
-
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
177
|
-
}
|
|
178
|
-
function isProfiler(object) {
|
|
179
|
-
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
180
|
-
}
|
|
181
|
-
function isStrictMode(object) {
|
|
182
|
-
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
183
|
-
}
|
|
184
|
-
function isSuspense(object) {
|
|
185
|
-
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
186
|
-
}
|
|
187
|
-
function isSuspenseList(object) {
|
|
188
|
-
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
exports.ContextConsumer = ContextConsumer;
|
|
192
|
-
exports.ContextProvider = ContextProvider;
|
|
193
|
-
exports.Element = Element;
|
|
194
|
-
exports.ForwardRef = ForwardRef;
|
|
195
|
-
exports.Fragment = Fragment;
|
|
196
|
-
exports.Lazy = Lazy;
|
|
197
|
-
exports.Memo = Memo;
|
|
198
|
-
exports.Portal = Portal;
|
|
199
|
-
exports.Profiler = Profiler;
|
|
200
|
-
exports.StrictMode = StrictMode;
|
|
201
|
-
exports.Suspense = Suspense;
|
|
202
|
-
exports.SuspenseList = SuspenseList;
|
|
203
|
-
exports.isAsyncMode = isAsyncMode;
|
|
204
|
-
exports.isConcurrentMode = isConcurrentMode;
|
|
205
|
-
exports.isContextConsumer = isContextConsumer;
|
|
206
|
-
exports.isContextProvider = isContextProvider;
|
|
207
|
-
exports.isElement = isElement;
|
|
208
|
-
exports.isForwardRef = isForwardRef;
|
|
209
|
-
exports.isFragment = isFragment;
|
|
210
|
-
exports.isLazy = isLazy;
|
|
211
|
-
exports.isMemo = isMemo;
|
|
212
|
-
exports.isPortal = isPortal;
|
|
213
|
-
exports.isProfiler = isProfiler;
|
|
214
|
-
exports.isStrictMode = isStrictMode;
|
|
215
|
-
exports.isSuspense = isSuspense;
|
|
216
|
-
exports.isSuspenseList = isSuspenseList;
|
|
217
|
-
exports.isValidElementType = isValidElementType;
|
|
218
|
-
exports.typeOf = typeOf;
|
|
219
|
-
|
|
220
|
-
})));
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-is.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/
|
|
10
|
-
(function(){'use strict';(function(b,c){"object"===typeof exports&&"undefined"!==typeof module?c(exports):"function"===typeof define&&define.amd?define(["exports"],c):(b=b||self,c(b.ReactIs={}))})(this,function(b){function c(a){if("object"===typeof a&&null!==a){var b=a.$$typeof;switch(b){case q:switch(a=a.type,a){case d:case e:case f:case g:case h:return a;default:switch(a=a&&a.$$typeof,a){case t:case k:case l:case m:case n:case p:return a;default:return b}}case r:return b}}}var q=Symbol.for("react.element"),
|
|
11
|
-
r=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),e=Symbol.for("react.profiler"),p=Symbol.for("react.provider"),k=Symbol.for("react.context"),t=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),n=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),u=Symbol.for("react.offscreen");var v=Symbol.for("react.module.reference");b.ContextConsumer=k;b.ContextProvider=p;b.Element=
|
|
12
|
-
q;b.ForwardRef=l;b.Fragment=d;b.Lazy=m;b.Memo=n;b.Portal=r;b.Profiler=e;b.StrictMode=f;b.Suspense=g;b.SuspenseList=h;b.isAsyncMode=function(a){return!1};b.isConcurrentMode=function(a){return!1};b.isContextConsumer=function(a){return c(a)===k};b.isContextProvider=function(a){return c(a)===p};b.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===q};b.isForwardRef=function(a){return c(a)===l};b.isFragment=function(a){return c(a)===d};b.isLazy=function(a){return c(a)===m};b.isMemo=
|
|
13
|
-
function(a){return c(a)===n};b.isPortal=function(a){return c(a)===r};b.isProfiler=function(a){return c(a)===e};b.isStrictMode=function(a){return c(a)===f};b.isSuspense=function(a){return c(a)===g};b.isSuspenseList=function(a){return c(a)===h};b.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===d||a===e||a===f||a===g||a===h||a===u||"object"===typeof a&&null!==a&&(a.$$typeof===m||a.$$typeof===n||a.$$typeof===p||a.$$typeof===k||a.$$typeof===l||a.$$typeof===v||void 0!==
|
|
14
|
-
a.getModuleId)?!0:!1};b.typeOf=c});
|
|
15
|
-
})();
|