Skip to content

ref(recursiveStructuredData): Lift Wrapper component to module scope#120039

Closed
sentry[bot] wants to merge 1 commit into
masterfrom
seer/ref/lift-wrapper-recursive-structured-data
Closed

ref(recursiveStructuredData): Lift Wrapper component to module scope#120039
sentry[bot] wants to merge 1 commit into
masterfrom
seer/ref/lift-wrapper-recursive-structured-data

Conversation

@sentry

@sentry sentry Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

This PR addresses a static-component-definitions coding convention violation identified in static/app/components/structuredEventData/recursiveStructuredData.tsx.

Problem:
The Wrapper component was defined as a nested function within the RecursiveStructuredData component's render function. This meant that a new Wrapper component type was created on every render. React treats such dynamically created components as new identities, leading to unnecessary unmounting and remounting of their subtrees, state resets, and preventing React Compiler optimizations.

Solution:
The Wrapper component has been moved to module scope, outside of the RecursiveStructuredData function. Its dependency on formattedObjectKey (which was previously captured via closure) is now passed explicitly as a prefix prop. This ensures Wrapper has a stable identity across renders, resolving the static-component-definitions violation and allowing for proper React reconciliation and compiler optimizations.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Fixes CODING-CONVENTIONS-34V

Comment @sentry <feedback> on this PR to have Autofix iterate on the changes.

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 19, 2026
@ryan953

ryan953 commented Jul 20, 2026

Copy link
Copy Markdown
Member

replaced by #120038

@ryan953 ryan953 closed this Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant