How do I get Prev state in setState?

prevState() is the same as the setState but the only difference between them is that if we want to change the state of a component based on the previous state of that component, we use this. setState() , which provides us the prevState .

Sizin İçin Seçtik  What is state and props in JavaScript?

Leave a Reply

Your email address will not be published. Required fields are marked *