We've created components as ES6 classes but that's not the only way to create a React component. You can also create a component as a function. Learn how the syntax differs in this video.
Now we can just straight up steal these…from our neighboring component here…so I will cut and paste them into this component.…Now the next thing I want to do is we're seeing an error…because we have this SkiDayCounter defined twice.…This is overwriting this one and it's like,…what are you trying to return.…So instead, I'll just comment that out for now…and then I'll see that total powder backcountry total…and goal are not defined.…So we're passing these values down…but we're not really accessing them from anywhere.…
So the way that we access these is with props.…
- Refactoring elements with JSX
- Creating components
- Adding component properties and methods
- Displaying child components
- Working with props and state
- Conditional rendering
Skill Level Intermediate
1. What Is React?
2. Introduction to React Elements
3. React Components
4. Props and State
5. Additional Library Features
- 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.