Skip to content

Commit

Permalink
[DevTools] Fix React Compiler badging
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
poteto and hoxyq committed Oct 14, 2024
1 parent 6cf8518 commit d9fce36
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/react-devtools-shared/src/backend/fiber/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,8 @@ export function getInternalReactConstants(version: string): {
!shouldSkipForgetCheck &&
// $FlowFixMe[incompatible-type] fiber.updateQueue is mixed
(fiber.updateQueue?.memoCache != null ||
(Array.isArray(fiber.memoizedState) &&
fiber.memoizedState[0]?.[REACT_MEMO_CACHE_SENTINEL]) ||
fiber.memoizedState?.memoizedState?.[REACT_MEMO_CACHE_SENTINEL])
) {
const displayNameWithoutForgetWrapper = getDisplayNameForFiber(
Expand Down

0 comments on commit d9fce36

Please sign in to comment.