Put in order · JavaScript and React course · Module 8: Advanced React Patterns
Introduction: HOC Implementation Pattern
Arrange the HOC implementation:
Items to put in order
- const { isAuthenticated, user } = useAuth();
- return function AuthComponent(props) {
- if (!isAuthenticated) return <LoginScreen />;
- return <WrappedComponent {...props} user={user} />;
- function withGalacticAuth(WrappedComponent) {
You can check the correct answer by solving this task in the CodeWorlds game.