Created
April 23, 2021 12:24
-
-
Save sabesansathananthan/cc943c59dc68ba6ff009e34da384a27c 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 React.Component { | |
render() { | |
return ( | |
<div class="layout"> | |
<WrappedComponent {...this.props} /> | |
</div> | |
); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment