Showing posts with label getSnapshotBeforeUpdate. Show all posts
Showing posts with label getSnapshotBeforeUpdate. Show all posts

Wednesday, August 15, 2018

React Component Lifecycle - getSnapshotBeforeUpdate

The getSnapshotBeforeUpdate life-cycle method is invoked before the DOM is updated. We can use this method to capture any settings / position information from the DOM before it gets updated. We can pass value from this method to the componentDidUpdate life-cycle method as a third parameter. Any value returned from this method will automatically be passed to the componentDidUpdate method.