Skip to content

Commit d9fce36

Browse files
potetohoxyq
andcommitted
[DevTools] Fix React Compiler badging
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]>
1 parent 6cf8518 commit d9fce36

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) &&
603+
fiber.memoizedState[0]?.[REACT_MEMO_CACHE_SENTINEL]) ||
602604
fiber.memoizedState?.memoizedState?.[REACT_MEMO_CACHE_SENTINEL])
603605
) {
604606
const displayNameWithoutForgetWrapper = getDisplayNameForFiber(

0 commit comments

Comments
 (0)