Skip to content
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

Combine Checkbox and RadioButton? #68

Open
youngmanalive opened this issue Mar 8, 2019 · 1 comment
Open

Combine Checkbox and RadioButton? #68

youngmanalive opened this issue Mar 8, 2019 · 1 comment
Assignees

Comments

@youngmanalive
Copy link
Contributor

<Checkbox> and <RadioButton> both use the <SelectorButton> component.

Both files are literally identical, save for the selector prop specifying whether it's radio or checkbox.

// ...

const Checkbox = ({ checked, onClick, children, type, ...rest }) => (
  <SelectorButton
    selector="checkbox"
    checked={checked}
    onClick={onClick}
    type={type}
    {...rest}
  >
    {children}
  </SelectorButton>
);

Might it make sense to have one component in which you just specify the selector?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants