From 452553ab05269d9c6eda0f0e550297d0202f2dc2 Mon Sep 17 00:00:00 2001 From: Abhra Jaiswal Date: Thu, 6 Nov 2025 09:37:46 +0530 Subject: [PATCH] Fix Profiler crash: ensure .map is called on array in SidebarEventInfo.js; remove type annotations for JS compatibility. Fixes facebook/react#35049 --- .../devtools/views/Profiler/SidebarEventInfo.js | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/packages/react-devtools-shared/src/devtools/views/Profiler/SidebarEventInfo.js b/packages/react-devtools-shared/src/devtools/views/Profiler/SidebarEventInfo.js index 8b55e0f8c0c09..f134ff9deec57 100644 --- a/packages/react-devtools-shared/src/devtools/views/Profiler/SidebarEventInfo.js +++ b/packages/react-devtools-shared/src/devtools/views/Profiler/SidebarEventInfo.js @@ -28,11 +28,8 @@ import styles from './SidebarEventInfo.css'; export type Props = {}; -type FunctionLocationProps = { - location: ReactFunctionLocation, - displayName: string, -}; -function FunctionLocation({location, displayName}: FunctionLocationProps) { +// Removed type alias FunctionLocationProps +function FunctionLocation({location, displayName}) { // TODO: We should support symbolication here as well, but // symbolicating the whole stack can be expensive const [canViewSource, viewSource] = useOpenResource(location, null); @@ -50,11 +47,9 @@ function FunctionLocation({location, displayName}: FunctionLocationProps) { ); } -type SchedulingEventProps = { - eventInfo: SchedulingEvent, -}; +// Removed type alias SchedulingEventProps -function SchedulingEventInfo({eventInfo}: SchedulingEventProps) { +function SchedulingEventInfo({eventInfo}) { const {componentName, timestamp} = eventInfo; const componentStack = eventInfo.componentStack || null; @@ -83,7 +78,7 @@ function SchedulingEventInfo({eventInfo}: SchedulingEventProps) {