-
Notifications
You must be signed in to change notification settings - Fork 4
Conversation
|
||
/** | ||
* Button Component | ||
* | ||
* HTML button element | ||
*/ | ||
export const Button = ({ className, children, onClick, ref, ...props }) => { | ||
export const Button = ({ className, children, onClick, ref, variant, size, type, isDisabled, ...props }) => { |
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.
If you destructure each of the levers in the constructor you can keep the {...props}
on the button HTML element which might come in handy. If you don't destructure the props arg then you can't use {...props}
on the HTML element as React doesn't know what to do with props like isDisabled: bool
default: | ||
levers.size = classnames('su-px-26 su-py-10 su-text-20'); |
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.
Moved default to the default so you don't have to pass in the keyword default
.
Co-authored-by: Sherakama <sherakama@gmail.com>
Co-authored-by: Sherakama <sherakama@gmail.com>
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.
Cool - thanks!
READY FOR REVIEW