React 16 introduces some new methods to the component lifecycle, including getDerivedStateFromProps and getSnapshotBeforeUpdate. Work with new lifecycle methods with confidence after watching this video.
- [Instructor] Whenever you create a React component,…there are several life cycle methods that you can use…to execute code at particular moments…in the life span of a component.…Now if you have the life cycle methods…that we have used in the past will be deprecated…in React 17.…For that reason, I'm just going to talk about the ones…that will work in the foreseeable future…and some new ones that were introduced with React 16.…The most recognizable and the most used method…of the component life cycle is Render.…Render is called when the component is first mounted,…but it's also called when new props come in…or when Set State is called.…
The mounting life cycle also includes the following:…we have the constructor, this is called…before the component is mounted…and is a place to initialize state.…We also have getDerivedStateFromProps…in the mounting life cycle.…This is invoked right after the component is constructed.…And then finally we have component DidMount,…which is called right after the component is mounted.…
- What's new in React 16
- Rendering arrays
- Controlled, uncontrolled, and compound components
- Using keyed fragments
- Working with new lifecycle methods
- React patterns
- Using the context API
- Checking for accessibility issues in your React code
Skill Level Advanced
1. What’s New in React
2. Advanced Components
3. Enhanced Components
4. React Patterns
5. React Accessibility
- 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.