From the course: React for Web Designers
Unlock this course with a free trial
Join today to access over 22,600 courses taught by industry experts.
Set up first simple component - React.js Tutorial
From the course: React for Web Designers
Set up first simple component
- [Instructor] In this video we're going to create the ProductImage component for the photo of the sneaker and we're going to change our ProductCustomizer into a component as well, so it can contain all the other components. So here's our index.html file in its current state, just our little "Hello world" element here. And here's the mock-up. So we're going to create the component for this product image and the wrapper. Switching back to My Editor, we're going to get started here. Currently, ProductCustomizer is just an element. We're going to change this. We're going to make this into a component. Now, there are two kinds of components that you can create in React. You can create functions and you can create classes. Usually, we start out with functions because they're simpler to do and then if we need more power, we can always change them into a class later. So I'm going to redefine this as a function. So doing it this way, we're creating what's called a functional component. When…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Installing React on an existing site8m 7s
-
(Locked)
Identifying your components and data3m 19s
-
(Locked)
Set up first simple component5m 31s
-
(Locked)
Start using JSX with the help of Babel7m 57s
-
(Locked)
Attaching a data source3m 20s
-
(Locked)
Create a new component with array data5m 56s
-
(Locked)
Implement props4m 28s
-
(Locked)
Implement state with the useState hook5m 11s
-
(Locked)
Add the color selector component3m 27s
-
(Locked)
Change options, see reactions6m 14s
-
(Locked)
Challenge: Activate the color selector1m 58s
-
(Locked)
Solution3m 4s
-
(Locked)
-
-
-