-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Components: polish ToggleGroupControl
#35600
Components: polish ToggleGroupControl
#35600
Conversation
const { ButtonContentView, LabelPlaceholderView, LabelView } = styles; | ||
|
||
function ToggleGroupControlOption( | ||
props: WordPressComponentProps< ToggleGroupControlOptionProps, 'button' >, |
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.
I had to update this type from
WordPressComponentProps< ToggleGroupControlOptionProps, 'input' >
to
WordPressComponentProps< ToggleGroupControlOptionProps, 'button' >
because otherwise TypeScript would throw an error on the Radio
component, since it has the as="button"
prop.
a98e01b
to
648c4b4
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! Thanks for working on this @ciampo!
Description
This PR is a refactor of the
ToggleGroupControl
component:ToggleGroupControlButton
component directly into theToggleGroupControlOption
component, as proposed in FixToggleGroupControlOption
not passingref
to the underlying element #35546 (comment)Tracking changes commit-by-commit may offer an easier way to review this PR.
I will potentially follow-up with another PR splitting the code in each
component.tsx
into a separatehook.ts
file, as per the guidelinesHow has this been tested?
There should be no runtime behavioural changes:
Types of changes
Refactor / tidy up
Checklist:
*.native.js
files for terms that need renaming or removal).