Calling setState() with a function but not using previous state
A common React anti-pattern is using the functional form of setState() (or state setters in hooks) without actually utilizing the previous state parameter. This unnecessarily complicates code and can sometimes….