Skip to content

Instantly share code, notes, and snippets.

@jtmthf
Last active May 5, 2018 20:31
Show Gist options
  • Save jtmthf/1c84949a2e637df9ed7010dcbf4770a0 to your computer and use it in GitHub Desktop.
Save jtmthf/1c84949a2e637df9ed7010dcbf4770a0 to your computer and use it in GitHub Desktop.
type Props<T> = T extends 'div'
? JSX.IntrinsicElements['div']
: T extends keyof JSX.IntrinsicElements
? TagProps<T>
: T extends ComponentType<infer P>
? ComponentProps<P> : never;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment