Tabs: Update subcomponents to accept full HTML element props #55860
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related comment.
What?
Updates the subcomponents (TabList, Tab, and TabPanel) to accept all of the HTML element props relevant to their underlying DOM elements.
This PR also removes some artifacts of an old
iconprop that was removed earlier in the component's development. There were still some references in the types and tests files that needed to be removed.Why?
Previously the Tabs subcomponents explicitly accepted props like
classNameandstyle, but not the general props for their respective DOM elements. This made it hard to pass basic props, and made it necessary to overuse therenderprop to gain access to them (example)How?
Each of the subcomponents now leverages
WordPressComponentPropsto include all of the relevant HTML element props.Testing Instructions
Tabsdefault story in Storybook.divrelated HTML props to aTabListandTabPanelsubcomponent (hidden,style,classNamefor example, but experiment with any prop that's valid on adiv.)divfor the subcomponent you modified.buttonrelated props to aTabsubcomponent. Specifically, test anonClickto confirm that it's applied and functions correctly.