Skip to content

Instantly share code, notes, and snippets.

@KrisKnez
Created June 15, 2023 20:38
Show Gist options
  • Save KrisKnez/af2233d1d6064ff07ab698a969fd9195 to your computer and use it in GitHub Desktop.
Save KrisKnez/af2233d1d6064ff07ab698a969fd9195 to your computer and use it in GitHub Desktop.
React Typescript Hight Order Component (HOC) inherit Compound Components
If you have a React component with compount components e.g. List, List.Item using HOC will remove compound components.
For the HOC to inherit compound components you need to do it manually.
Use a library like: https://www.npmjs.com/package/hoist-non-react-statics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment