Skip to content

Commit 9806a4b

Browse files
potetohoxyq
andauthored
[DevTools] Fix React Compiler badging (#31196)
In #31140 we switched over the uMC polyfill to use memo instead of state since memo would FastRefresh properly. However this busted devtools' badging of compiled components; this PR fixes it. TODO: tests Co-authored-by: Ruslan Lesiutin <[email protected]> --------- Co-authored-by: Ruslan Lesiutin <[email protected]>
1 parent ec2bf02 commit 9806a4b

File tree

1 file changed

+2
-0
lines changed
  • packages/react-devtools-shared/src/backend/fiber

1 file changed

+2
-0
lines changed

packages/react-devtools-shared/src/backend/fiber/renderer.js

+2
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,8 @@ export function getInternalReactConstants(version: string): {
599599
!shouldSkipForgetCheck &&
600600
// $FlowFixMe[incompatible-type] fiber.updateQueue is mixed
601601
(fiber.updateQueue?.memoCache != null ||
602+
(Array.isArray(fiber.memoizedState?.memoizedState) &&
603+
fiber.memoizedState.memoizedState[0]?.[REACT_MEMO_CACHE_SENTINEL]) ||
602604
fiber.memoizedState?.memoizedState?.[REACT_MEMO_CACHE_SENTINEL])
603605
) {
604606
const displayNameWithoutForgetWrapper = getDisplayNameForFiber(

0 commit comments

Comments
 (0)