Join Eve Porcello for an in-depth discussion in this video Creating React components with ES6, part of Learning React.js (2016).
- [Instructor] When React was first introduced,…create class was the only way to create a component.…Since then, two other techniques have emerged.…In this video we'll take a look at…how to create a component using an ES6 class,…so if you're familiar with ES6 class syntax,…you know that we'll use the class keyword.…So, here on line twelve I'm going to…start creating this adjacent to our MyComponent,…and we're just gonna refactor this as an ES6 class.…So, again, we're gonna use class MyComponent…extends React.Component.…
Then we're going to use the render function here,…and inside the render function…we'll simply use the same thing we used before,…so let's cut and paste this return…and paste it right here into this method.…So, now I can do away with my old create class component,…and I don't need to make any adjustments…to react on that render.…This is going to work in the exact same way.…So let's give this a save,…and we'll take a look at it in our browser,…and we should see that the same result appears.…
Hello World, This is my first React component.…
- What is React.js?
- Introducing JSX
- Creating a React component
- Handling events
- Using state
- Working with PropTypes
- Adding child elements
- Mounting and updating components
- Creating a React.js app
Skill Level Beginner
Building a Web Interface with React.jswith Ray Villalobos1h 21m Intermediate
1. What Is React.js?
2. Getting Started
3. React Components
4. Props and State
5. Enhancing Components
6. Creating an App
Using create-react-app4m 38s
Next steps1m 4s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
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.