From d5e72247e7a3da3b3cc250f82d5f81821642dc15 Mon Sep 17 00:00:00 2001 From: meowtec Date: Wed, 20 Jan 2021 17:54:57 +0800 Subject: [PATCH] Devtool: `$r` should contain `hooks` property when it is forwardRef or memo component --- packages/react-devtools-shared/src/backend/renderer.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/react-devtools-shared/src/backend/renderer.js b/packages/react-devtools-shared/src/backend/renderer.js index ee90dfee688ac..cc82fda74cdb1 100644 --- a/packages/react-devtools-shared/src/backend/renderer.js +++ b/packages/react-devtools-shared/src/backend/renderer.js @@ -2795,6 +2795,7 @@ export function attach( break; case ForwardRef: global.$r = { + hooks, props, type: type.render, }; @@ -2802,6 +2803,7 @@ export function attach( case MemoComponent: case SimpleMemoComponent: global.$r = { + hooks, props, type: elementType != null && elementType.type != null