Button exercise: adding props
parent
339e914e82
commit
b120028817
@ -1,6 +1,13 @@
|
|||||||
|
|
||||||
export const Button = () => {
|
interface Props {
|
||||||
|
children: string;
|
||||||
|
color: string;
|
||||||
|
onClick: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const Button = ({ children, color, onClick }: Props) => {
|
||||||
|
//const buttonType = "btn " + "btn"+"-"+{type};
|
||||||
return (
|
return (
|
||||||
<button type="button" className="btn btn-primary">Primary</button>
|
<button type="button" className={'btn btn-'+color} onClick={onClick}>{children}</button>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue