-
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
SelectControl
: mark the children
prop as optional
#37872
Conversation
Size Change: 0 B Total Size: 1.13 MB ℹ️ View Unchanged
|
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.
This looks good to me.
I just wonder why InputBaseProps
requires children
in the first place. It doesn't make much sense to me.
Edit: Oh, okay! It looks like InputBase
is just a wrapper for an input field. Maybe SelectControl
should use InputControlProps
instead?
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.
Thanks for fixing this one @ciampo 👍
✅ Confirmed the typing errors prior to checking out this PR
✅ Confirmed the error was resolved after applying these changes
✅ Tests pass
Edit: Oh, okay! It looks like InputBase is just a wrapper for an input field. Maybe SelectControl should use InputControlProps instead?
I gave this a quick test and it looks like we need to then omit other props e.g. value
, onChange
etc. The current use of InputBaseProps
appears cleanest to me.
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.
Thanks @ciampo! Just adding another ✅ while I'm here, too. Confirmed the TS error in color-picker/component.tsx
before this PR, and that it's resolved after applying the PR 👍
Thanks all for the review! Will rebase, solve conflicts, and merge as soon as checks are ✅
I tend to agree with @aaronrobertshaw |
5e8d598
to
e84fbcb
Compare
* `SelectControl`: mark the `children` prop as optional * Update prop documentation * Rename Storybook example * Changelog
Description
This PR fixes a regression introduced by #29540, where the
children
prop of theSelectControl
component was introduced and marked as non-optional.This PR sets the
children
prop as optional in the TypeScript definitions. It also updates the docs and the storybook example (although these changes are minor)How has this been tested?
Without changes from this PR
packages/components/src/color-picker/component.tsx
file in a text editor that supports TypeScript lintingSelectControl
component about not definingchildren
With changes from this PR
Types of changes
Checklist:
*.native.js
files for terms that need renaming or removal).