Skip to content

fix(ui): Fix CodeTabs to show multiple tabs#16930

Merged
chargome merged 1 commit intomasterfrom
cg/fix-tabs
Mar 13, 2026
Merged

fix(ui): Fix CodeTabs to show multiple tabs#16930
chargome merged 1 commit intomasterfrom
cg/fix-tabs

Conversation

@chargome
Copy link
Member

The existing child?.props filter in CodeTabs was silently dropping these, causing only the first tab to render (e.g. only "Client" visible instead of Client/Server/Edge on the NextJS manual setup page).

Broken:
Screenshot 2026-03-13 at 14 16 43

Fixed:
Screenshot 2026-03-13 at 14 18 11

@chargome chargome self-assigned this Mar 13, 2026
@vercel
Copy link

vercel bot commented Mar 13, 2026

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

Project Deployment Actions Updated (UTC)
develop-docs Ready Ready Preview, Comment Mar 13, 2026 1:24pm
sentry-docs Ready Ready Preview, Comment Mar 13, 2026 1:24pm

Request Review

Copy link

@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 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Unvalidated _init result may crash downstream destructuring
    • Added validation to check that the result of _init has a props property before returning it from resolveElement, preventing crashes when destructuring props downstream.

Create PR

Or push these changes by commenting:

@cursor push 0d7d4a308f

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

}
if (child._init && child._payload) {
try {
return child._init(child._payload);
Copy link

Choose a reason for hiding this comment

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

Unvalidated _init result may crash downstream destructuring

Medium Severity

The return value of child._init(child._payload) is passed through without validating it has props. The filter only checks !== null, so if _init returns undefined or a non-null object without props, it passes through. This causes a TypeError on the possibleChoices line where {props: {title, language}} is destructured. The old .filter(child => child?.props) was more defensive. The resolved result from _init needs a props check before being returned.

Additional Locations (1)
Fix in Cursor Fix in Web

Copy link
Collaborator

@inventarSarah inventarSarah left a comment

Choose a reason for hiding this comment

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

Thank you for fixing this so quickly!! 🎉

@chargome chargome merged commit 2db2c72 into master Mar 13, 2026
20 checks passed
@chargome chargome deleted the cg/fix-tabs branch March 13, 2026 13:39
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