-
Notifications
You must be signed in to change notification settings - Fork 0
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
Exchange defaultProps for default parameters in function components #1226
base: main
Are you sure you want to change the base?
Changes from 8 commits
643aa8b
424d980
081fb80
1fe8bc7
52768af
cb4a3e4
b8bced1
71d6502
1cb16a8
da1b453
b088d05
d2932a8
8728469
721751b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It occurred to me that you could do something like this in the component: function CheckboxTree<T>(partialProps: Props<T>) {
const props = { ...defaultProps, ...partialProps };
// ...
} If a prop is defined in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would be so much nicer. I tried this for a bit but could not shake a |
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 don't think we need this. Isn't
selectedList
an option prop for CheckboxTree?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.
It is but we use
selectedList
below to auto close the popover.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.
(line 45 ish)