Can useCallback memoize callbacks that use state setters or context values?
useCallback can cache a callback that uses state setters, state values, or context values from the component scope. However, Hooks such as useState and useContext must be called at the top level of a component or custom Hook, not inside the callback body. Reactive values used inside the callback should be included in the dependency array.