A higher-order component is a function that takes a component and returns a new component. It provides a way to share data between components through composition.
- [Instructor] A higher order component is a function…that takes in a component and returns a new component.…It provides a way to share data…between components through composition.…The place I want to get started with this…is to get rid of all of our code from the previous lesson…and we're going to replace it…with our higher order component.…Now the component that I wanna render here…is gonna be called random users.…I'll call it RandomMeUsers,…and here we're going to start to create our people list.…
So the RandomMeUsers is going to…take in some data and display it.…And the display component is going to be called PeopleList.…So const PeopleList should take in some data.…From here we want to render an ordered list.…So the PeopleList is gonna be a pretty…textbook presentation component.…It's just gonna render some tags…and it's going to load some data.…So the data is gonna come from data.results.map.…
When we map over the results we're going to…pass in person and i and these should yield our data for us.…Let's go ahead and destructure first…
- What's new in React 16
- Rendering arrays
- Controlled, uncontrolled, and compound components
- Using keyed fragments
- Working with new lifecycle methods
- React patterns
- Using the context API
- Checking for accessibility issues in your React code
Skill Level Advanced
1. What’s New in React
2. Advanced Components
3. Enhanced Components
4. React Patterns
5. React Accessibility
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.