ReactJS – Component Life Cycle In Depth (Continue)

ReactJS – Component Life Cycle In Depth (Continue)

As we have discussed about MOUNTING  here and we will continue to discuss about UPDATING life cycles in REACT in this Section. UPDATING 3. getSnapshotBeforeUpdate(prevProps, prevState) getSnapshotBeforeUpdate() is invoked right before the most recently rendered output is committed to e.g. the DOM. It enables your component to capture some information from the DOM (e.g. scroll position) […]