-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tabs: cleanup and improvements #56224
Conversation
c959cd1
to
8be2a47
Compare
Flaky tests detected in 34ae69d. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6897370662
|
22ebe28
to
3d3588d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
Good to be merged once comments are addressed
What?
A few small updates to the
Tabs
component family:useTabContext()
consistently, instead of sometimes usinguseContext()
Tabs.Context
Why?
These are items that came up while working on other things. While they could be broken into their own separate PRs, they felt small enough to batch together. More specifically:
useTabContext()
No change in behavior here, it just wasn't being used consistently
Memoize context value
Was causing unnecessary re-renders.
Expose
Tabs.Context
In some implications involving
slot
/fills
, it's necessary to wrap subcomponents in an additional context provider. See #55360 for a real-life example. This also meant updating the warning thrown when context is missing to include the possibility of using aTabs.Context.Provider
Add sub-components to Storybook
I forgot them initially, but now they can be viewed in the component docs in Storybook.
Testing Instructions
N/A, other than making sure all the tests pass.