From f0031dc6ed8801cc638c2f378911a93ceb8e2412 Mon Sep 17 00:00:00 2001 From: Berton Zhu Date: Mon, 25 Jan 2021 23:35:02 +0800 Subject: [PATCH] Devtool: `$r` should contain `hooks` property when it is forwardRef or memo component (#20626) --- 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