Skip to content

ECHOES-1266 Backport#661

Merged
jeremy-davis-sonarsource merged 2 commits intobranch-2.0from
jay/backport-2.0
Mar 24, 2026
Merged

ECHOES-1266 Backport#661
jeremy-davis-sonarsource merged 2 commits intobranch-2.0from
jay/backport-2.0

Conversation

@jeremy-davis-sonarsource
Copy link
Copy Markdown
Contributor

No description provided.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 24, 2026

Deploy Preview for echoes-react ready!

Name Link
🔨 Latest commit eda73bb
🔍 Latest deploy log https://app.netlify.com/projects/echoes-react/deploys/69c296e3c4cfa800086e2962
😎 Deploy Preview https://deploy-preview-661--echoes-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@hashicorp-vault-sonar-prod
Copy link
Copy Markdown

hashicorp-vault-sonar-prod bot commented Mar 24, 2026

ECHOES-1266

@sonar-review-alpha
Copy link
Copy Markdown

Summary

This backport hardens React 19 ref handling to prevent callback-ref update loops. It applies patches to Radix UI's compose-refs and radio-group that skip forwarding null values to function refs, adds deduplication logic to the useForwardedRef hook, and improves dependency documentation. These changes prevent maximum update depth errors that occur when function refs trigger state updates that cause the ref to detach/reattach in a feedback loop.

What reviewers should know

Start by reviewing the two .yarn/patches files—they show the specific Radix UI fixes: skipping null calls to function refs in setRef, and replacing a useState + callback pattern with useRef in radio-group. Then check src/common/helpers/useForwardedRef.ts which applies similar null-skipping logic with added deduplication to local state updates. The sidebar-navigation changes are just refactoring (extracting a constant and mocking it in tests). The package.json.md additions document why these patches exist. All changes are minimal and focused on preventing ref-driven render loops in React 19.


  • Generate Walkthrough
  • Generate Diagram

🗣️ Give feedback

@sonarqube-next
Copy link
Copy Markdown

@jeremy-davis-sonarsource jeremy-davis-sonarsource enabled auto-merge (rebase) March 24, 2026 14:04
Copy link
Copy Markdown

@sonar-review-alpha sonar-review-alpha bot left a comment

Choose a reason for hiding this comment

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

Conclusion: Solid backport. The ref-hardening logic is correct and the patches are well-targeted. One minor duplication worth cleaning up before it spreads further.

🗣️ Give feedback

@jeremy-davis-sonarsource jeremy-davis-sonarsource merged commit 6e1e6be into branch-2.0 Mar 24, 2026
13 checks passed
@jeremy-davis-sonarsource jeremy-davis-sonarsource deleted the jay/backport-2.0 branch March 24, 2026 14:31
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.

2 participants