Creates a stateful value, returning a getter and a setter function.
Use the useRef() hook to create a ref that holds the stateful value, initializing it with initialState.
Use the useReducer() hook that creates a new object every time it's updated and return its dispatch.
Use the useMemo() hook to memoize a pair of functions. The first one will return the current value of the state ref and the second one will update it and force a re-render.