The Header component has redundant useEffect blocks that both fetch userInfo from localStorage and dispatch the setUserInfo action. This results in multiple dispatches of setUserInfo whenever the auth state changes, potentially causing unintended updates to the auth state.
Solution:
Remove the useEffect that has auth as a dependency, keeping only the one that runs on the initial mount to load userInfo from localStorage.