Skip to content

Instantly share code, notes, and snippets.

@DmitryOlkhovoi
Created January 21, 2020 10:45
Show Gist options
  • Save DmitryOlkhovoi/069826d7c60e2e160033fad08f58e4cd to your computer and use it in GitHub Desktop.
Save DmitryOlkhovoi/069826d7c60e2e160033fad08f58e4cd to your computer and use it in GitHub Desktop.
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
primary?: boolean,
accent?: boolean,
additionalClass?: string,
}
...
const classNames = classnames(
'btn',
{
primary
},
{
accent
},
additionalClass
);
...
<button className={classNames} {...props}>props.children</button>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment