Skip to content

chore: memoize tabs children#188

Merged
lawreka merged 2 commits intomainfrom
kathryn/memoize-tabs-children
Jan 30, 2026
Merged

chore: memoize tabs children#188
lawreka merged 2 commits intomainfrom
kathryn/memoize-tabs-children

Conversation

@lawreka
Copy link
Contributor

@lawreka lawreka commented Jan 30, 2026

Summary

luckily we don't have the useTabsState hook here that we do in client for syncing + doing weird navigation jumps around when versions/dropdowns change, so this is a very light improvement

Test Plan

  • no visual changes

Note

Low Risk
Simple useMemo optimization in a UI component; low chance of behavioral impact beyond subtle changes if callers pass unstable children references.

Overview
Reduces unnecessary recomputation in TabsRoot by memoizing the derived arrayChildren list and the generated tabIds via useMemo, keeping IDs stable across renders unless children (or the component’s useId) changes.

No behavior or API surface is intentionally changed; this is a render/performance optimization for consumers like code-group and other Tabs usages.

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

@lawreka lawreka requested a review from pqoqubbw January 30, 2026 22:53
@lawreka lawreka merged commit 936f028 into main Jan 30, 2026
3 checks passed
@lawreka lawreka deleted the kathryn/memoize-tabs-children branch January 30, 2026 23:00
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