-
Notifications
You must be signed in to change notification settings - Fork 47.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename AsyncMode -> ConcurrentMode #13732
Changes from 1 commit
1c6fa33
5d6d348
87728c3
b9a3729
2782831
d02c8b8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,14 +71,19 @@ export const StrictMode = REACT_STRICT_MODE_TYPE; | |
|
||
export {isValidElementType}; | ||
|
||
let hasWarnedAboutDeprecatedIsAsyncMode = false; | ||
|
||
// AsyncMode should be deprecated | ||
export function isAsyncMode(object: any) { | ||
lowPriorityWarning( | ||
false, | ||
'The ReactIs.isAsyncMode() alias has been deprecated, ' + | ||
'and will be removed in React 17+. Update your code to use ' + | ||
'ReactIs.isConcurrentMode() instead. It has the exact same API.', | ||
); | ||
if (!hasWarnedAboutDeprecatedIsAsyncMode) { | ||
hasWarnedAboutDeprecatedIsAsyncMode = true; | ||
lowPriorityWarning( | ||
false, | ||
'The ReactIs.isAsyncMode() alias has been deprecated, ' + | ||
'and will be removed in React 17+. Update your code to use ' + | ||
'ReactIs.isConcurrentMode() instead. It has the exact same API.', | ||
); | ||
} | ||
return isConcurrentMode(object); | ||
} | ||
export function isConcurrentMode(object: any) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both this and symbol export rename would be a breaking change technically. Unfortunately we forgot the unstable prefix here. Let’s keep both and add a deprecation warning for isAsyncMode. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've made the change. Did I do it correctly? |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be inside
if (__DEV__)