Created
February 7, 2020 17:55
-
-
Save danlourenco/642df91c88fbfc8b44fd2658097c755d to your computer and use it in GitHub Desktop.
Revisions
-
danlourenco created this gist
Feb 7, 2020 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ const withHOC = (WrappedComponent) => { return class WithHoc extends React.Component { // custom methods to augment wrapped component render() { return <WrappedComponent {...this.props} /> } } } // usage const AppWithHoc = withHOC(App); <AppWithHoc />