fix(ui): Fix CodeTabs to show multiple tabs#16930
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Unvalidated
_initresult 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.
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); |
There was a problem hiding this comment.
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)
inventarSarah
left a comment
There was a problem hiding this comment.
Thank you for fixing this so quickly!! 🎉



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:

Fixed:
