From the course: React Hooks

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Working with component trees

Working with component trees - React.js Tutorial

From the course: React Hooks

Start my 1-month free trial

Working with component trees

- [Instructor] More often than not, our react applications are not a single component. So working with state in a component tree is really an important concept to know about. So what we're going to build in this lesson is a star rating component, so that we can rate anything: books, movies, restaurants. We can use it all over, all different types of applications. Now the app component is going to be responsible for just rendering another component. So the app component here, let's go ahead and say, return <StarRating />; We actually want to create it using a smaller component called a Star. So the Star component is going to be what makes up all of these StarRating components. And the star that we want to use is actually from a separate library called react icons. So let me go ahead and import it first, and then we're going to install it using npm. So over here in my terminal window, I need to run npm install react-icons.…

Contents