2022-11-10 10:43:16 +00:00
/ * *
* @ license React
2020-08-25 23:57:08 +00:00
* react - is . development . js
*
* Copyright ( c ) Facebook , Inc . and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* /
'use strict' ;
if ( process . env . NODE _ENV !== "production" ) {
( function ( ) {
'use strict' ;
2021-02-26 03:58:33 +00:00
// ATTENTION
// When adding new symbols to this file,
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
2022-11-10 10:43:16 +00:00
// The Symbol used to tag the ReactElement-like types.
var REACT _ELEMENT _TYPE = Symbol . for ( 'react.element' ) ;
var REACT _PORTAL _TYPE = Symbol . for ( 'react.portal' ) ;
var REACT _FRAGMENT _TYPE = Symbol . for ( 'react.fragment' ) ;
var REACT _STRICT _MODE _TYPE = Symbol . for ( 'react.strict_mode' ) ;
var REACT _PROFILER _TYPE = Symbol . for ( 'react.profiler' ) ;
var REACT _PROVIDER _TYPE = Symbol . for ( 'react.provider' ) ;
var REACT _CONTEXT _TYPE = Symbol . for ( 'react.context' ) ;
var REACT _SERVER _CONTEXT _TYPE = Symbol . for ( 'react.server_context' ) ;
var REACT _FORWARD _REF _TYPE = Symbol . for ( 'react.forward_ref' ) ;
var REACT _SUSPENSE _TYPE = Symbol . for ( 'react.suspense' ) ;
var REACT _SUSPENSE _LIST _TYPE = Symbol . for ( 'react.suspense_list' ) ;
var REACT _MEMO _TYPE = Symbol . for ( 'react.memo' ) ;
var REACT _LAZY _TYPE = Symbol . for ( 'react.lazy' ) ;
var REACT _OFFSCREEN _TYPE = Symbol . for ( 'react.offscreen' ) ;
// -----------------------------------------------------------------------------
2021-02-26 03:58:33 +00:00
var enableScopeAPI = false ; // Experimental Create Event Handle API.
2022-11-10 10:43:16 +00:00
var enableCacheElement = false ;
var enableTransitionTracing = false ; // No known bugs, but needs performance testing
var enableLegacyHidden = false ; // Enables unstable_avoidThisFallback feature in Fiber
// stuff. Intended to enable React core members to more easily debug scheduling
// issues in DEV builds.
var enableDebugTracing = false ; // Track which Fiber(s) schedule render work.
var REACT _MODULE _REFERENCE ;
{
REACT _MODULE _REFERENCE = Symbol . for ( 'react.module.reference' ) ;
}
2020-08-25 23:57:08 +00:00
function isValidElementType ( type ) {
2021-02-26 03:58:33 +00:00
if ( typeof type === 'string' || typeof type === 'function' ) {
return true ;
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
2022-11-10 10:43:16 +00:00
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 ) {
2021-02-26 03:58:33 +00:00
return true ;
}
if ( typeof type === 'object' && type !== null ) {
2022-11-10 10:43:16 +00:00
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
// types supported by any Flight configuration anywhere since
// we don't know which Flight build this will end up being used
// with.
type . $$typeof === REACT _MODULE _REFERENCE || type . getModuleId !== undefined ) {
2021-02-26 03:58:33 +00:00
return true ;
}
}
return false ;
2020-08-25 23:57:08 +00:00
}
function typeOf ( object ) {
if ( typeof object === 'object' && object !== null ) {
var $$typeof = object . $$typeof ;
switch ( $$typeof ) {
case REACT _ELEMENT _TYPE :
var type = object . type ;
switch ( type ) {
case REACT _FRAGMENT _TYPE :
case REACT _PROFILER _TYPE :
case REACT _STRICT _MODE _TYPE :
case REACT _SUSPENSE _TYPE :
2021-02-26 03:58:33 +00:00
case REACT _SUSPENSE _LIST _TYPE :
2020-08-25 23:57:08 +00:00
return type ;
default :
var $$typeofType = type && type . $$typeof ;
switch ( $$typeofType ) {
2022-11-10 10:43:16 +00:00
case REACT _SERVER _CONTEXT _TYPE :
2020-08-25 23:57:08 +00:00
case REACT _CONTEXT _TYPE :
case REACT _FORWARD _REF _TYPE :
case REACT _LAZY _TYPE :
case REACT _MEMO _TYPE :
case REACT _PROVIDER _TYPE :
return $$typeofType ;
default :
return $$typeof ;
}
}
case REACT _PORTAL _TYPE :
return $$typeof ;
}
}
return undefined ;
2021-02-26 03:58:33 +00:00
}
2020-08-25 23:57:08 +00:00
var ContextConsumer = REACT _CONTEXT _TYPE ;
var ContextProvider = REACT _PROVIDER _TYPE ;
var Element = REACT _ELEMENT _TYPE ;
var ForwardRef = REACT _FORWARD _REF _TYPE ;
var Fragment = REACT _FRAGMENT _TYPE ;
var Lazy = REACT _LAZY _TYPE ;
var Memo = REACT _MEMO _TYPE ;
var Portal = REACT _PORTAL _TYPE ;
var Profiler = REACT _PROFILER _TYPE ;
var StrictMode = REACT _STRICT _MODE _TYPE ;
var Suspense = REACT _SUSPENSE _TYPE ;
2022-11-10 10:43:16 +00:00
var SuspenseList = REACT _SUSPENSE _LIST _TYPE ;
2021-02-26 03:58:33 +00:00
var hasWarnedAboutDeprecatedIsAsyncMode = false ;
var hasWarnedAboutDeprecatedIsConcurrentMode = false ; // AsyncMode should be deprecated
2020-08-25 23:57:08 +00:00
function isAsyncMode ( object ) {
{
if ( ! hasWarnedAboutDeprecatedIsAsyncMode ) {
hasWarnedAboutDeprecatedIsAsyncMode = true ; // Using console['warn'] to evade Babel and ESLint
2021-02-26 03:58:33 +00:00
console [ 'warn' ] ( 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 18+.' ) ;
2020-08-25 23:57:08 +00:00
}
}
2021-02-26 03:58:33 +00:00
return false ;
2020-08-25 23:57:08 +00:00
}
function isConcurrentMode ( object ) {
2021-02-26 03:58:33 +00:00
{
if ( ! hasWarnedAboutDeprecatedIsConcurrentMode ) {
hasWarnedAboutDeprecatedIsConcurrentMode = true ; // Using console['warn'] to evade Babel and ESLint
console [ 'warn' ] ( 'The ReactIs.isConcurrentMode() alias has been deprecated, ' + 'and will be removed in React 18+.' ) ;
}
}
return false ;
2020-08-25 23:57:08 +00:00
}
function isContextConsumer ( object ) {
return typeOf ( object ) === REACT _CONTEXT _TYPE ;
}
function isContextProvider ( object ) {
return typeOf ( object ) === REACT _PROVIDER _TYPE ;
}
function isElement ( object ) {
return typeof object === 'object' && object !== null && object . $$typeof === REACT _ELEMENT _TYPE ;
}
function isForwardRef ( object ) {
return typeOf ( object ) === REACT _FORWARD _REF _TYPE ;
}
function isFragment ( object ) {
return typeOf ( object ) === REACT _FRAGMENT _TYPE ;
}
function isLazy ( object ) {
return typeOf ( object ) === REACT _LAZY _TYPE ;
}
function isMemo ( object ) {
return typeOf ( object ) === REACT _MEMO _TYPE ;
}
function isPortal ( object ) {
return typeOf ( object ) === REACT _PORTAL _TYPE ;
}
function isProfiler ( object ) {
return typeOf ( object ) === REACT _PROFILER _TYPE ;
}
function isStrictMode ( object ) {
return typeOf ( object ) === REACT _STRICT _MODE _TYPE ;
}
function isSuspense ( object ) {
return typeOf ( object ) === REACT _SUSPENSE _TYPE ;
}
2022-11-10 10:43:16 +00:00
function isSuspenseList ( object ) {
return typeOf ( object ) === REACT _SUSPENSE _LIST _TYPE ;
}
2020-08-25 23:57:08 +00:00
exports . ContextConsumer = ContextConsumer ;
exports . ContextProvider = ContextProvider ;
exports . Element = Element ;
exports . ForwardRef = ForwardRef ;
exports . Fragment = Fragment ;
exports . Lazy = Lazy ;
exports . Memo = Memo ;
exports . Portal = Portal ;
exports . Profiler = Profiler ;
exports . StrictMode = StrictMode ;
exports . Suspense = Suspense ;
2022-11-10 10:43:16 +00:00
exports . SuspenseList = SuspenseList ;
2020-08-25 23:57:08 +00:00
exports . isAsyncMode = isAsyncMode ;
exports . isConcurrentMode = isConcurrentMode ;
exports . isContextConsumer = isContextConsumer ;
exports . isContextProvider = isContextProvider ;
exports . isElement = isElement ;
exports . isForwardRef = isForwardRef ;
exports . isFragment = isFragment ;
exports . isLazy = isLazy ;
exports . isMemo = isMemo ;
exports . isPortal = isPortal ;
exports . isProfiler = isProfiler ;
exports . isStrictMode = isStrictMode ;
exports . isSuspense = isSuspense ;
2022-11-10 10:43:16 +00:00
exports . isSuspenseList = isSuspenseList ;
2020-08-25 23:57:08 +00:00
exports . isValidElementType = isValidElementType ;
exports . typeOf = typeOf ;
} ) ( ) ;
}