Skip to content

Instantly share code, notes, and snippets.

@JoshuaKGoldberg
Last active March 29, 2020 17:55
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 JoshuaKGoldberg/9b4fd7b3b9d6df2566d23db7a6e8815d to your computer and use it in GitHub Desktop.
Save JoshuaKGoldberg/9b4fd7b3b9d6df2566d23db7a6e8815d to your computer and use it in GitHub Desktop.
React Components Options
// Option one??
interface MyThingProps { /* ... */ };
function MyThing({ text }: MyThingProps { /* ... */ };
// Option two??
type MyThingProps = { /* ... */ };
const MyThing = ({ text }: MyThingProps) => { /* ... */ };
// Option three??
type MyThingProps = { /* ... */ };
const MyThing: React.FC<MyThingProps> = ({ text }) => { /* ... */ };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment