State is data our app is dependent upon
To use state we need to keep track of it using useState
We never mutate the state directly but instead always pass new state. This is the only way for react to know what changed
Then react performs these states and updates the ui
useState gives us a tuple of two values the first one is the current state and the second one is the updator function
Getting the previous value
We can also pass a callback that will automatically get the previous value
This is important as state updates are batched
When setting new object in state we normally use spread
State changes with array (remove, add and filter and array of objects)