Skip to content

fix: detect memo/forwardRef/HOC components missing from scan outlines…#428

Open
Yashwantha24 wants to merge 1 commit into
aidenybai:mainfrom
Yashwantha24:fix-regex-issue
Open

fix: detect memo/forwardRef/HOC components missing from scan outlines…#428
Yashwantha24 wants to merge 1 commit into
aidenybai:mainfrom
Yashwantha24:fix-regex-issue

Conversation

@Yashwantha24
Copy link
Copy Markdown

@Yashwantha24 Yashwantha24 commented Mar 10, 2026

… (Issue #252)


Note

Medium Risk
Touches core instrumentation and outline generation to change how fibers are identified/named; mistakes could drop/rename components or slightly increase overhead during commit traversal.

Overview
Fixes missing components in scan outlines/render logs by improving how component names are resolved for React.memo, React.forwardRef, and HOC wrappers.

Adds getFiberName(fiber) and uses it in both instrumentation (componentName) and outlineFiber, plus adjusts traversal to fall back from getType() to wrapper fiber.type objects so anonymous wrappers aren’t skipped.

Written by Cursor Bugbot for commit 707d569. This will update automatically on new commits. Configure here.

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
react-scan Skipped Skipped Mar 10, 2026 5:58am

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

}
// devtools may set displayName on the wrapper object itself
return (type as { displayName?: string }).displayName || null;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nested memo/forwardRef wrappers return null in outlines

Medium Severity

getFiberName fails to resolve names for memo(forwardRef(Component)), a common React pattern. In the MemoComponentTag branch, type.type is the forwardRef wrapper object (not a function), so the typeof inner === 'function' check fails and the function falls through to type.displayName || null. The actual component function at type.type.render is never examined. In outlineFiber, there's no fallback — unlike instrumentation.ts which falls back to getDisplayName(type) — so these components are silently dropped from scan outlines.

Additional Locations (1)

Fix in Cursor Fix in Web

} from 'bippy';
import { isValidElement } from 'preact';
import { isEqual } from '~core/utils';
import { getFiberName } from '~core/utils';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate import from same module

Low Severity

~core/utils is imported twice on consecutive lines — isEqual on line 24 and getFiberName on line 25. These are separate import statements from the same module and could be consolidated into a single import.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant