React useState is the core piece of modern React applications, however, a lot of developers are using it without really knowing what it is doing under the hood.

While it’s pretty easy to use it with primitive types such as stringsboolean, or number, it might get a bit handy when playing with referenced types such as objects/maps or arrays.

Those mistakes generate commons questions like :

Why is my UI not showing the latest state after changing my React state?

Or another close one:

I updated my React state but I can’t see changes, why?

You might be in such a state even without knowing it as it might be a false-positive situation where everything seems to works, but it’s just a random case that succeeded.

#javascript #react #react-native

Top 5 Commons Mistakes with React useState hook and How to Prevent them
12.55 GEEK