Created
April 25, 2021 04:24
-
-
Save sabesansathananthan/b3b369ae8bbcafe1cd20f453793a707c 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
const HOC = (WrappedComponent) => { | |
return class EnhancedComponent extends WrappedComponent { | |
componentDidMount(){ | |
// ... | |
} | |
render() { | |
return super.render(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment