React and TypeScript React and TypeScript

Higher Order Components Exercise

Check out a free preview of the full React and TypeScript course:
The "Higher Order Components Exercise" Lesson is part of the full, React and TypeScript course featured in this preview video. Here's what you'd learn in this lesson:

Students are instructed to create a WithCurrentUser higher-order component that passes in the basic user information and accepts a manually passed salutation prop.

Get Unlimited Access Now

Transcript from the "Higher Order Components Exercise" Lesson

[00:00:00]
>> All right, so now you're getting your hands dirty. I've got another kinda simple example from a lot earlier, where we're going to take the name tag and we're gonna try to pull out the, we're gonna try to do a width current user that will pass in. We're gonna create a width current user higher-order component.

[00:00:17] It's gonna pass in the basic user information. But the extra challenge at this point, we still wanna accept that salutation prop manually. So it's kind of a little bit of an extension. So I'll give you a chance to kind of get your hands dirty with the pattern, and then we'll do it together as a team.