Remove deprecated methods from react-is (#28224)

These aren't being used anywhere and don't even correspond to real APIs.
This commit is contained in:
dan
2024-02-11 00:25:17 +00:00
committed by GitHub
parent 06e410ec60
commit 35b2c28178
3 changed files with 0 additions and 34 deletions

View File

@@ -24,8 +24,6 @@ export {
StrictMode,
Suspense,
SuspenseList,
isAsyncMode,
isConcurrentMode,
isContextConsumer,
isContextProvider,
isElement,

View File

@@ -24,8 +24,6 @@ export {
StrictMode,
Suspense,
SuspenseList,
isAsyncMode,
isConcurrentMode,
isContextConsumer,
isContextProvider,
isElement,

View File

@@ -76,36 +76,6 @@ export const SuspenseList = REACT_SUSPENSE_LIST_TYPE;
export {isValidElementType};
let hasWarnedAboutDeprecatedIsAsyncMode = false;
let hasWarnedAboutDeprecatedIsConcurrentMode = false;
// AsyncMode should be deprecated
export function isAsyncMode(object: any): boolean {
if (__DEV__) {
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
hasWarnedAboutDeprecatedIsAsyncMode = true;
// Using console['warn'] to evade Babel and ESLint
console['warn'](
'The ReactIs.isAsyncMode() alias has been deprecated, ' +
'and will be removed in React 18+.',
);
}
}
return false;
}
export function isConcurrentMode(object: any): boolean {
if (__DEV__) {
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;
}
export function isContextConsumer(object: any): boolean {
return typeOf(object) === REACT_CONTEXT_TYPE;
}