Skip to content

Instantly share code, notes, and snippets.

@frivolta
Created May 27, 2022 15:38
Show Gist options
  • Save frivolta/b428804f395b54dfe508144ba60afc0a to your computer and use it in GitHub Desktop.
Save frivolta/b428804f395b54dfe508144ba60afc0a to your computer and use it in GitHub Desktop.
Write better React, compose multiple functional HoCs, Higher-Order Components - Wrapped Component
// 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