Skip to content

Instantly share code, notes, and snippets.

@mitzen
Created July 22, 2023 08:18
Show Gist options
  • Select an option

  • Save mitzen/72e17bc19e202ac019f7aae89130829a to your computer and use it in GitHub Desktop.

Select an option

Save mitzen/72e17bc19e202ac019f7aae89130829a to your computer and use it in GitHub Desktop.
// declare your component
import type { ComponentPropsWithoutRef } from 'react';
interface ButtonProps extends ComponentPropsWithoutRef<"button"> {
label: string;
}
export function MyButton({ label, ...rest }: ButtonProps) {
return (<button><button {...rest} /></button>);
}
/// how to use it ////////
import {InputGroup, MyButton} from './com';
export default function About() {
let [counter, setCounter] = useState<number>(100)
return <div>Hello
<MyButton label='test'> </MyButton>
</div>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment