1010'use strict' ;
1111
1212import {
13- REACT_ASYNC_MODE_TYPE ,
14- REACT_CONCURRENT_MODE_TYPE ,
1513 REACT_CONTEXT_TYPE ,
1614 REACT_ELEMENT_TYPE ,
1715 REACT_FORWARD_REF_TYPE ,
@@ -34,8 +32,6 @@ export function typeOf(object: any) {
3432 const type = object . type ;
3533
3634 switch ( type ) {
37- case REACT_ASYNC_MODE_TYPE :
38- case REACT_CONCURRENT_MODE_TYPE :
3935 case REACT_FRAGMENT_TYPE :
4036 case REACT_PROFILER_TYPE :
4137 case REACT_STRICT_MODE_TYPE :
@@ -63,9 +59,6 @@ export function typeOf(object: any) {
6359 return undefined ;
6460}
6561
66- // AsyncMode is deprecated along with isAsyncMode
67- export const AsyncMode = REACT_ASYNC_MODE_TYPE ;
68- export const ConcurrentMode = REACT_CONCURRENT_MODE_TYPE ;
6962export const ContextConsumer = REACT_CONTEXT_TYPE ;
7063export const ContextProvider = REACT_PROVIDER_TYPE ;
7164export const Element = REACT_ELEMENT_TYPE ;
@@ -81,6 +74,7 @@ export const Suspense = REACT_SUSPENSE_TYPE;
8174export { isValidElementType } ;
8275
8376let hasWarnedAboutDeprecatedIsAsyncMode = false ;
77+ let hasWarnedAboutDeprecatedIsConcurrentMode = false ;
8478
8579// AsyncMode should be deprecated
8680export function isAsyncMode ( object : any ) {
@@ -90,15 +84,24 @@ export function isAsyncMode(object: any) {
9084 // Using console['warn'] to evade Babel and ESLint
9185 console [ 'warn' ] (
9286 'The ReactIs.isAsyncMode() alias has been deprecated, ' +
93- 'and will be removed in React 17+. Update your code to use ' +
94- 'ReactIs.isConcurrentMode() instead. It has the exact same API.' ,
87+ 'and will be removed in React 17+.' ,
9588 ) ;
9689 }
9790 }
98- return isConcurrentMode ( object ) || typeOf ( object ) === REACT_ASYNC_MODE_TYPE ;
91+ return false ;
9992}
10093export function isConcurrentMode ( object : any ) {
101- return typeOf ( object ) === REACT_CONCURRENT_MODE_TYPE ;
94+ if ( __DEV__ ) {
95+ if ( ! hasWarnedAboutDeprecatedIsConcurrentMode ) {
96+ hasWarnedAboutDeprecatedIsConcurrentMode = true ;
97+ // Using console['warn'] to evade Babel and ESLint
98+ console [ 'warn' ] (
99+ 'The ReactIs.isConcurrentMode() alias has been deprecated, ' +
100+ 'and will be removed in React 17+.' ,
101+ ) ;
102+ }
103+ }
104+ return false ;
102105}
103106export function isContextConsumer ( object : any ) {
104107 return typeOf ( object ) === REACT_CONTEXT_TYPE ;
0 commit comments