RFC: Global object to expose react internals like __REACT_DEVTOOLS_GLOBAL_HOOK__
#267
+105
−68
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.
The idea is to offer an API that developers can actually rely on instead of
__REACT_DEVTOOLS_GLOBAL_HOOK__
so we can develop tools that interact with the state of some components externally like React Devtools does, but in a safer way. Or to force rerenders or remounting, depending on what we expose in this api.Currently you can use bippy, but it has this warning in its README:
Warning
this project uses react internals, which can change at any time. it is not recommended to depend on internals unless you really, really have to. by proceeding, you acknowledge the risk of breaking your own code or apps that use your code.