Getting current state value from setState function in React

Today I learned, I knew this before but today saw it in a practical example. In our react setState function we can get the prevState and return the new state within the same function which I think is very helpful.

code snippet for setState

2 Comments

  1. alim

    programming hero তে আমি আপনার React Native শিখেছিলাম। i want to learn more from you if you have any paid course. Please, inform me, please.

Leave a Reply

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