mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
[devtools] fix: support optionality of structured stack trace function name (#33697)
Follow-up to https://github.com/facebook/react/pull/33680. Turns out `.getFunctionName` not always returns string.
This commit is contained in:
@@ -360,8 +360,9 @@ function collectStackTrace(
|
||||
const callSite = structuredStackTrace[i];
|
||||
const name = callSite.getFunctionName();
|
||||
if (
|
||||
name.includes('react_stack_bottom_frame') ||
|
||||
name.includes('react-stack-bottom-frame')
|
||||
name != null &&
|
||||
(name.includes('react_stack_bottom_frame') ||
|
||||
name.includes('react-stack-bottom-frame'))
|
||||
) {
|
||||
// We pick the last frame that matches before the bottom frame since
|
||||
// that will be immediately inside the component as opposed to some helper.
|
||||
|
||||
Reference in New Issue
Block a user