Let's start by asking ourselves why would we need the previous state? There might be some cases where you need to render a different view which also changes the current state based on the previous state. Consider a simple example - you have an ON/OF...

Markdown supported · ⌘↵ to post
Karan Hejmadi
paddingleft
How about - setCount(prevCount => prevCount + 1)}