-
Notifications
You must be signed in to change notification settings - Fork 45.6k
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
add legacy context API warning in strict mode #12849
Changes from all commits
ac72ea0
ca4b796
dc9480a
33c9ad1
7e3e547
740f21f
1fe6316
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 |
---|---|---|
|
@@ -14,6 +14,7 @@ const ReactFeatureFlags = { | |
debugRenderPhaseSideEffects: false, | ||
debugRenderPhaseSideEffectsForStrictMode: false, | ||
warnAboutDeprecatedLifecycles: true, | ||
warnAboutLegacyContextAPI: true, | ||
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. Curiosity question: Did we intentionally turn this on for RN renderer but not but for www? (It's probably good to turn it on for both.) 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'm not sure about this. Maybe ask @acdlite 😄 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. Let's turn it on for the following feature flag forks:
export const warnAboutLegacyContextAPI = __DEV__; 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. If we realize this causes problems during the next www sync (which I'll be running) we can back it off then. 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. Why are they ever off? It's only read in strict mode, yeah? My understanding was that these 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. The two side effect flags are controlled by GKs internally. They're off by default, but can be turned on by injection. (xplat feature flags can't directly reference |
||
}; | ||
|
||
module.exports = ReactFeatureFlags; |
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.
Looks like we're not catching functional components here. They can also have
contextTypes
and should also be warned about.