-
Notifications
You must be signed in to change notification settings - Fork 49.1k
[DevTools] Support FunctionComponent.contextTypes #19028
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
Closed
Closed
Changes from 17 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
4eaa1c1
add fixture to InspectableElements/Contexts.js
bl00mber 33a86ec
support FunctionComponent.contextTypes
bl00mber 51b3c89
fix babel/babel#11216
bl00mber bede31a
enable up to 17 version
bl00mber 882d0df
enable contextTypes on FunctionComponent only
bl00mber 16d99ca
add check on second block
bl00mber edf95a9
do not access context to prevent errors if legacyContext is disabled
bl00mber 6821a8d
Merge branch 'master' into devtools/support-contextTypes
bl00mber fcb10ef
lint
bl00mber b3c4023
Merge branch 'master' into devtools/support-contextTypes
bl00mber 42e39b8
Merge branch 'master' into devtools/support-contextTypes
bl00mber 3fd54f0
revert 51b3c89
bl00mber bef507b
retract versionFlags
bl00mber 96b75d6
Update packages/react-devtools-shared/src/backend/renderer.js
bl00mber 3b5d739
Update packages/react-debug-tools/src/ReactDebugHooks.js
bl00mber 87339c3
fix
bl00mber bc8cddd
add test
bl00mber 745204b
update test
bl00mber File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
Why is the test doing this check? Seems kind of like lower-level implementation details, and could also lead to a false positive (e.g. replace with
!!childFiber.elementType.contextTypess
above and the test would still pass because the boolean check would just fail silently).Since we know the legacy context is being used here, why do we need a conditional at all?
The test also doesn't verify that the expected context value gets injected.
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.
That was my probably inappropriate attempt to prevent test from running on versions where context should be deprecated.
Removed a conditional & added value verification.