This doesn’t clear the thing that both the functions passed to setState have different prevState. Since they are async calls, the methods are called one after the other, and both of them should have the same prevState. I am not able to understand that how passing a function instead of object, makes any difference.

    Vipul kumar basapati

    Written by

    Tech Enthusiast, learner by birth. Workout with @laravel and @react and @node

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade