Last active
February 26, 2018 14:07
-
-
Save treyhuffine/0f7eb412632d7e41f58aae4d463db18e to your computer and use it in GitHub Desktop.
A simple example of HOC
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
import React from 'react'; | |
const higherOrderComponent = (WrappedComponent) => { | |
class HOC extends React.Component { | |
render() { | |
return <WrappedComponent />; | |
} | |
} | |
return HOC; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment