Skip to content

Commit

Permalink
Remove deprecated methods from react-is (facebook#28224)
Browse files Browse the repository at this point in the history
These aren't being used anywhere and don't even correspond to real APIs.
  • Loading branch information
gaearon authored and AndyPengc12 committed Apr 15, 2024
1 parent 074de08 commit cd26292
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 34 deletions.
2 changes: 0 additions & 2 deletions packages/react-is/index.experimental.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ export {
StrictMode,
Suspense,
SuspenseList,
isAsyncMode,
isConcurrentMode,
isContextConsumer,
isContextProvider,
isElement,
Expand Down
2 changes: 0 additions & 2 deletions packages/react-is/index.stable.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ export {
StrictMode,
Suspense,
SuspenseList,
isAsyncMode,
isConcurrentMode,
isContextConsumer,
isContextProvider,
isElement,
Expand Down
30 changes: 0 additions & 30 deletions packages/react-is/src/ReactIs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit cd26292

Please sign in to comment.