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

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…

Contents