Join Eve Porcello for an in-depth discussion in this video Creating React components as stateless components, part of Learning React.js.
- [Instructor] So far we've explored…how to create a component using create class,…and we've also used ES6 classes.…The third way that we can use to create a component…is we can use a stateless functional component.…A stateless functional component…is just a simple function that returns react elements.…So, here on line twelve I'm going to create…a const, and this constant variable…is going to be a function.…So, I'm going to use an ES6 arrow function.…Now, I can take my return statement here.…
I can cut and paste this directly into line thirteen,…directly into this function.…So I'll remove the old one, I'll give this a save,…and let's check this out in the browser.…We should see that this is rendering correctly.…It's returning the same result,…a div that contains an h1 and a paragraph.…So this is a syntax that you'll commonly see…in react documentation in other projects,…so I just wanted to make you aware of it.…A stateless functional component, again,…is just a simple function that returns a react element.…
- 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?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
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.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.