Created
June 19, 2021 20:36
-
-
Save sabesansathananthan/93ebe7dfa9c0c6becc6e84990c27097e to your computer and use it in GitHub Desktop.
How React Components Are Reused
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
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