[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]>
This commit is contained in:
lauren
2024-10-15 12:53:45 +01:00
committed by GitHub
co-authored by Ruslan Lesiutin
parent 06624d2cfd
commit 59e174e216
@@ -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?.memoizedState) &&
fiber.memoizedState.memoizedState[0]?.[REACT_MEMO_CACHE_SENTINEL]) ||
fiber.memoizedState?.memoizedState?.[REACT_MEMO_CACHE_SENTINEL])
) {
const displayNameWithoutForgetWrapper = getDisplayNameForFiber(