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