The other day, by mere coincidence, I came across a functionality I did not know about regarding React\'s useState. I found out you can actually do something like this: