File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import {
21
21
REACT_STRICT_MODE_TYPE ,
22
22
} from 'shared/ReactSymbols' ;
23
23
import isValidElementType from 'shared/isValidElementType' ;
24
+ import lowPriorityWarning from 'shared/lowPriorityWarning' ;
24
25
25
26
export function typeOf ( object : any ) {
26
27
if ( typeof object === 'object' && object !== null ) {
@@ -56,6 +57,8 @@ export function typeOf(object: any) {
56
57
return undefined ;
57
58
}
58
59
60
+ // AsyncMode alias is deprecated along with isAsyncMode
61
+ export const AsyncMode = REACT_CONCURRENT_MODE_TYPE ;
59
62
export const ConcurrentMode = REACT_CONCURRENT_MODE_TYPE ;
60
63
export const ContextConsumer = REACT_CONTEXT_TYPE ;
61
64
export const ContextProvider = REACT_PROVIDER_TYPE ;
@@ -68,6 +71,16 @@ export const StrictMode = REACT_STRICT_MODE_TYPE;
68
71
69
72
export { isValidElementType } ;
70
73
74
+ // AsyncMode should be deprecated
75
+ export function isAsyncMode ( object : any ) {
76
+ lowPriorityWarning (
77
+ false ,
78
+ 'The ReactIs.isAsyncMode() alias has been deprecated, ' +
79
+ 'and will be removed in React 17+. Update your code to use ' +
80
+ 'ReactIs.isConcurrentMode() instead. It has the exact same API.'
81
+ ) ;
82
+ return isConcurrentMode ( object ) ;
83
+ }
71
84
export function isConcurrentMode ( object : any ) {
72
85
return typeOf ( object ) === REACT_CONCURRENT_MODE_TYPE ;
73
86
}
You can’t perform that action at this time.
0 commit comments