Skip to content

About the author of Daydream Drift

Tomasz Niezgoda (LinkedIn/tomaszniezgoda & GitHub/tniezg) is the author of this blog. It contains original content written with care.

Please link back to this website when referencing any of the materials.

Author:

About React's "snapshot" Lifecycle Method

Published

A word about React's getSnapshotBeforeUpdate.

It's only useful in a very specific situation.

When there's something to measure in the DOM before the measured thing is re-rendered inside the render method of a Component and adjusted again inside componentDidUpdate afterwards. In other cases, componentDidUpdate is enough.

It seems to me that getSnapshotBeforeUpdate is already a legacy method in React. And it just barely came out.