Created
May 27, 2022 15:38
-
-
Save frivolta/b428804f395b54dfe508144ba60afc0a to your computer and use it in GitHub Desktop.
Write better React, compose multiple functional HoCs, Higher-Order Components - Wrapped Component
This file contains 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
// A page component that just render text | |
const App = (props) => { | |
return ( | |
<div className="App"> | |
<h1>A component</h1> | |
<h2>User: {props.currentUser.email}</h2> | |
</div> | |
); | |
}; | |
// Wrapping with withUser function | |
export default withUser(App); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment