-
-
Notifications
You must be signed in to change notification settings - Fork 202
Feature/menu checkbox and radio #101
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
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 8eb8238:
|
src/components/Checkbox/Checkbox.js
Outdated
const CheckboxComponent = | ||
variant === 'flat' ? StyledFlatCheckbox : StyledCheckbox; | ||
|
||
const CheckboxComponent = { |
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.
What do you think about declaring this CheckboxComponent
outside of render? Since the components are static I don't see a need to declare them on every render, what do you think?
Just to be clear, my idea is to declare the checkbox components outside of render and only instantiate the component that'll be used inside of render, like:
// outside of render
const CheckboxComponents = {
flat: StyledFlatCheckbox,
default: StyledCheckbox,
menu: StyledMenuCheckbox
}
// inside of render
const CheckboxVariant = CheckboxComponents[variant]
Does that make sense for you?
src/components/Radio/Radio.js
Outdated
const CheckboxComponent = | ||
variant === 'flat' ? StyledFlatCheckbox : StyledCheckbox; | ||
|
||
const CheckboxComponent = { |
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.
Same thing for declaring this outside of render goes here.
🎉 This PR is included in version 3.0.0-beta.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
closes #92