Created
April 13, 2020 18:50
-
-
Save sriramrudraraju/b4fcb31def69abb81d56a3a103679477 to your computer and use it in GitHub Desktop.
typescripts for react HOC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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