Solving conflicting react router redirects
Summary The user is experiencing a race condition between the React Router navigate function and the Redux state update triggered by dispatch(logout()). The attempt to navigate to the homepage (/) in Header.jsx is being immediately overridden by the ProtectedRoute component. When the user clicks “Sign Out” on the /profile page: navigate(“/”) is called. dispatch(logout()) is … Read more