Skip to content

Instantly share code, notes, and snippets.

@Keraito
Last active June 7, 2022 21:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Keraito/8cbb2612bd9edfece56108ae5a7f280e to your computer and use it in GitHub Desktop.
Save Keraito/8cbb2612bd9edfece56108ae5a7f280e to your computer and use it in GitHub Desktop.
import { MouseEventHandler, PropsWithChildren } from "react";
type ComponentProps = {
title: string;
caption: string;
onClick: MouseEventHandler<HTMLButtonElement>;
};
const Component = (props: ComponentProps) => (
<div>
<h2>{props.title}</h2>
<button onClick={props.onClick}>{props.caption}</button>
</div>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment