mirror of
https://github.com/facebook/react.git
synced 2026-02-22 03:42:05 +00:00
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:
@@ -24,8 +24,6 @@ export {
|
||||
StrictMode,
|
||||
Suspense,
|
||||
SuspenseList,
|
||||
isAsyncMode,
|
||||
isConcurrentMode,
|
||||
isContextConsumer,
|
||||
isContextProvider,
|
||||
isElement,
|
||||
|
||||
@@ -24,8 +24,6 @@ export {
|
||||
StrictMode,
|
||||
Suspense,
|
||||
SuspenseList,
|
||||
isAsyncMode,
|
||||
isConcurrentMode,
|
||||
isContextConsumer,
|
||||
isContextProvider,
|
||||
isElement,
|
||||
|
||||
30
packages/react-is/src/ReactIs.js
vendored
30
packages/react-is/src/ReactIs.js
vendored
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user