Why is it a good idea to pass a function to setState instead of an object?
setState
setState is asynchronous and might result in out of sync values.
It makes sure that the object is not mutated.
It provides better encapsulation.
It automatically updates a component.