Skip to content

Commit

Permalink
Add Debug Tools Package for Introspection of Hooks (#14085)
Browse files Browse the repository at this point in the history
* Add debug tools package

* Add basic implementation

* Implement inspection of the current state of hooks using the fiber tree

* Support useContext hooks inspection by backtracking from the Fiber

I'm not sure this is safe because the return fibers may not be current
but close enough and it's fast.

We use this to set up the current values of the providers.

* rm copypasta

* Use lastIndexOf

Just in case. I don't know of any scenario where this can happen.

* Support ForwardRef

* Add test for memo and custom hooks

* Support defaultProps resolution
  • Loading branch information
sebmarkbage authored Nov 5, 2018
1 parent 49f6fc8 commit af641b0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/ReactTestRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ const validWrapperTypes = new Set([
HostComponent,
ForwardRef,
MemoComponent,
SimpleMemoComponent,
// Normally skipped, but used when there's more than one root child.
HostRoot,
]);
Expand Down

0 comments on commit af641b0

Please sign in to comment.