Created
May 27, 2022 15:37
-
-
Save frivolta/f27ac173f8614f2ed8572d6556b38cd2 to your computer and use it in GitHub Desktop.
Write better React, compose multiple functional HoCs, Higher-Order Components - Higher Order 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
export const withUser = (Component) => (props) => { | |
// Passing the user that you fetched | |
const currentUser = { authtenticated: true, email: "[email protected]" }; | |
return <Component currentUser={currentUser} {...props} />; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment