Join Eve Porcello for an in-depth discussion in this video PropTypes, part of Learn React.js: The Basics (2015).
- When working on our React projects,…there are methods that we can use…to ensure that our components are using props…and receiving data appropriately.…Let's go ahead and add property validation…as well as a parent component to our new application.…The first thing we want to do here on line 48…is create a new component called board.…Board is going to be the parent component for our notes.…The notes will be displayed on the board.…Inside of our board component we want to…render a div, so we will return a div,…and the div should have a className of board.…
And this is just getting pulled…straight from our CSS style sheet.…The next thing that we want to do here…is we want to add a new method called propTypes.…PropTypes is a method that's part of the React library…and it helps us to handle validation.…So propTypes is going to be an object.…We'll separate this by a comma.…And we then want to specify the name of our property.…So in this case it's count the number of notes…that appear on our board.…
Count is going to be a function…
- What is React.js?
- Introducing JSX
- Creating a React component
- Handling events
- Using state
- Defining parent/child relationships
- Adding child elements
- Mounting and updating components
- Creating a React.js app
Skill Level Beginner
Up and Running with AngularJS 1with Ray Villalobos1h 20m Intermediate
1. What is React.js?
2. Getting Started
3. React Components
4. Parent/Child Relationships
5. Component Life Cycle
6. Creating an App
Next steps1m 5s
- 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.