[Perf Tracks] Handle function names that aren't strings (#35659)
Sebastian "Sebbie" Silbermann committed
Jan 29, 2026 at 18:32 UTC
da64117876002bd60baa9e93cad77421bbf0293f
1 file changed
+7
-2
packages/shared/ReactPerformanceTrackProperties.js
+7
-2
@@ -253,10 +253,15 @@ export function addValueToProperties(
253
return;
254
}
255
case 'function':
256
- if (value.name === '') {
256
+ const functionName = value.name;
257
+ if (
258
+ functionName === '' ||
259
+ // e.g. proxied functions or classes with a static property "name" that's not a string
260
+ typeof functionName !== 'string'
261
+ ) {
262
desc = '() => {}';
263
} else {
259
- desc = value.name + '() {}';
264
+ desc = functionName + '() {}';
265
}
266
break;
267
case 'string':