From af641b035131d88762fac4048c58c81dde4f7b77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Markb=C3=A5ge?= Date: Mon, 5 Nov 2018 10:02:59 -0800 Subject: [PATCH] Add Debug Tools Package for Introspection of Hooks (#14085) * 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 --- src/ReactTestRenderer.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ReactTestRenderer.js b/src/ReactTestRenderer.js index 21f0075..9ab3d97 100644 --- a/src/ReactTestRenderer.js +++ b/src/ReactTestRenderer.js @@ -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, ]);