From the course: React Hooks
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Working with component trees - React.js Tutorial
From the course: React Hooks
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…
Contents
-
-
-
-
(Locked)
Reviewing Array and Object destructuring3m 15s
-
(Locked)
Incorporating the useState Hook3m 35s
-
Building a checkbox with useState1m 59s
-
(Locked)
Working with component trees4m 9s
-
(Locked)
Sending interactions up component trees3m 40s
-
(Locked)
How to use CoderPad2m 51s
-
(Locked)
Solution: Building an interactive to-do list5m 37s
-
(Locked)
-
-
-
-
-