Join Eve Porcello for an in-depth discussion in this video Adding lifecycle methods to the bulletin board, part of Learning React.js (2016).
- [Instructor] Now that we understand…what component life cycle is,…we're going to take these new methods…and add them to our bulletin board app.…We've already added componentWillMount to the note…which is going to be called right before the render.…First, I'd like to make a quick enhancement…to the form.…Currently, if I click on edit, the new note text…does not appear here.…And then, if I save it, it'll be saved,…but then, if I try to edit it again,…it'll be gone.…So a quick way that I can handle this…is I can go to our Sublime Text…and I'm gonna take a look at our Render Form method.…
Here, I'm going to add a default value.…Actually, not to the div but to the text area.…So let's go ahead and add this and we're gonna use…default value, camel case and we're gonna set this…equal to this.props.children.…Great.…So the next thing I'm gonna do…is I'm going to add a new method here…to our note component and this is going to be called…componentDidUpdate.…So we'll put it right here between componentWillMount…and randomBetween, cponentDidUpdate is going…
- 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.