Dev tools inject get component name and describe component frame #16139
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.
This change is being made to enable DevTools to eagerly patch the console (before a renderer has been attached to the frontend) so that e.g. React Native developers can still get component stacks even if they aren't using the DevTools UI.
We don't strictly need to inject these methods, but since the logic for getting the display name of a component is tied to the renderer version, this simplifies things for DevTools.
At this point, it would be much easier to just inject
ReactDebugCurrentFrameand let it create the stacks for us- but that would prevent DevTools from being able to create an owners-only stack, which I think is rather nice to have.