Skip to content

Instantly share code, notes, and snippets.

@paulodutra
Created August 17, 2023 19:03
Show Gist options
  • Save paulodutra/124a65b23d13ec7f7ee60ed4225acded to your computer and use it in GitHub Desktop.
Save paulodutra/124a65b23d13ec7f7ee60ed4225acded to your computer and use it in GitHub Desktop.
Component button using React with typescript and ComponentProps
import React from 'react'
type ButtonProps = React.ComponentProps<"button"> & {
lenghtButton?: string
}
export const Button = ({children, lenghtButton, ...props}: ButtonProps) => {
return (
<button
style={{fontSize: lenghtButton}}
{...props}
>
{children}
</button>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment