Discover possible applications for componentDidUpdate.
- [Instructor] In this video,…we're going to be talking about component did update.…Component did update, unlike component will update,…is going to be looking at prev props and prev state…for arguments and so it's going to be occurring…after your component updated.…Now component did update is maybe a bit more useful…than component will update in that it allows you…to access items that have just been rendered.…Component did update might be a good opportunity…to scroll to a specific space on the page or to update a ref…because now everything has been rendered…and all of the objects on your dom are now available.…
Okay, so now let's use component did update in our project…and add it to our logger.…We're going to go into our app.js file…and I'm going to turn off logging right now…because it's showing a lot…and I'm going to scroll back up all the way to app…and beneath component will update…I'm going to make a call to component did update…and remember it takes in previous props and previous state…and then within the function body,…
Carl Peaslee helps you build a number of small reusable components that will be useful in future projects. Along the way, he discusses the syntax and uses of lifecycle methods, how state affects React lifecycles and your apps, and how to set static display name, default props, and initial state. Plus, learn how to gather performance data and improve performance by minimizing component updates.
- Overview of React lifecycles
- Initial state
- Default props
- Mounting: componentWillMount, componentDidMount, and render
- Updating: shouldComponentUpdate, componentWillUpdate, and componentDidUpdate
- Controlling component updates
- Using react-addons-perf to get performance data
Skill Level Intermediate
Building a Web Interface with React.jswith Ray Villalobos1h 21m Intermediate
1. Overview of Lifecycles
2. Defaults, Initialization, and Construction
5. Optimizing Components
- 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.