BetaBetaCalled immediately after updating occurs. Not called for the initial render.
The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.
Optionalsnapshot: { prevFocusedIndex: number; restoreSelection: { end: number; start: number } }BetaBetaRuns before React applies the result of Component.render render to the document, and returns an object to be given to componentDidUpdate. Useful for saving things such as scroll position before Component.render render causes changes to it.
Note: the presence of this method prevents any of the deprecated lifecycle events from running.
BetaBetaBetaBetaBetaBeta
Note: this should be a class component until React provides support for a hook version of getSnapshotBeforeUpdate
Hidden