---
title: "Discussion on \"How to get the PREVIOUS state in React?\" | Hashnode"
description: "Discussion on \"How to get the PREVIOUS state in React?\". How do you get the previous state value in React? Check this blog out!"
url: "https://hashnode.com/posts/how-to-get-the-previous-state-in-react/613c565022b7a41dfe5fb88a"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to get the PREVIOUS state in React?](https://karanhejmadi.hashnode.dev/how-to-get-the-previous-state-in-react?utm_source=hashnode&utm_medium=feed)

How do you get the previous state value in React? Check this blog out!

Sep 11, 2021 · 3 min read · karanhejmadi.hashnode.dev  
Read the article

-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#web-development](https://hashnode.com/tag/web-development)
-   [#javascript](https://hashnode.com/tag/javascript)

## Written by

[Karan Hejmadi](https://hashnode.com/@KaranHejmadi)

@KaranHejmadi · India

  
[View profile](https://hashnode.com/@KaranHejmadi)

Full Stack Developer

I am a software developer proficient in web application development. I also like creating UI/UX designs for web and mobile applications. I write about software development tips, resources and guides to get started.

## Responses 1

Markdown supported · ⌘↵ to post

[paddingleft](https://hashnode.com/@paddingleft)

[Sep 11, 2021](https://hashnode.com/posts/how-to-get-the-previous-state-in-react/613c565022b7a41dfe5fb88a/comment/613cb5121821961e2551ecb0)

How about - setCount(prevCount => prevCount + 1)}

[Sep 12, 2021](https://hashnode.com/posts/how-to-get-the-previous-state-in-react/613c565022b7a41dfe5fb88a/comment/613cb5121821961e2551ecb0#reply-613da27322b7a41dfe5fd66c)

You can do that as well. setCount(prevCount => prevCount+1) gets the previous state and adds 1 to it. I think it works better if you have several setState in batches.
