ReactJS getSnapshotBeforeUpdate() Method
The getSnapshotBeforeUpdate() method is invoked just before the DOM is being rendered. It is used to store the previous values of the state after the DOM is updated. Syntax:getSnapshotBeforeUpdate(prevProps, prevState)Parameters: It accepts two parameters, they are prevProps and prevState which are