Skip to content

Instantly share code, notes, and snippets.

@sriramrudraraju
Created April 13, 2020 18:50
Show Gist options
  • Save sriramrudraraju/b4fcb31def69abb81d56a3a103679477 to your computer and use it in GitHub Desktop.
Save sriramrudraraju/b4fcb31def69abb81d56a3a103679477 to your computer and use it in GitHub Desktop.
typescripts for react HOC
interface WithHocProps {
// hoc props
}
const withHoc = <T extends WithHocProps>(Component: React.ComponentType<T>) => {
return (props: T) => {
return (
<Component {...props}/>
);
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment