Skip to content

Instantly share code, notes, and snippets.

@jtmthf
Last active May 5, 2018 20:50
Show Gist options
  • Save jtmthf/5207e5542057c96243c60721c56f00f5 to your computer and use it in GitHub Desktop.
Save jtmthf/5207e5542057c96243c60721c56f00f5 to your computer and use it in GitHub Desktop.
type TagProps<Tag extends keyof JSX.IntrinsicElements> = {
is: Tag;
innerRef?: JSX.IntrinsicElements[Tag]['ref'];
} & JSX.IntrinsicElements[Tag];
type StatelessComponentProps<P> = {
is: SFC<P>;
} & P;
type ComponentClassProps<T, P> = {
is: ComponentClass<P>;
innerRef?: (instance: T | null) => any;
} & P;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment