Skip to content

Instantly share code, notes, and snippets.

@sabesansathananthan
Created June 19, 2021 20:36
Show Gist options
  • Save sabesansathananthan/93ebe7dfa9c0c6becc6e84990c27097e to your computer and use it in GitHub Desktop.
Save sabesansathananthan/93ebe7dfa9c0c6becc6e84990c27097e to your computer and use it in GitHub Desktop.
How React Components Are Reused
function enhance(WrappedComponent) {
class Enhance extends React.Component {/*...*/}
// Must know exactly which methods should be copied :(
Enhance.staticMethod = WrappedComponent.staticMethod;
return Enhance;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment