Skip to content

add location.replace() api ? #10800

Closed Answered by brophdawg11
vaynevayne asked this question in Q&A
Discussion options

You must be logged in to vote

This is possible via useNavigate: https://reactrouter.com/en/main/hooks/use-navigate#optionsreplace

let navigate = useNavigate();
React.useEffect(() => fetchSomeData(),[])
const doLogin = () => {
  navigate('/', { replace: true });
}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@vaynevayne
Comment options

@brophdawg11
Comment options

Answer selected by brophdawg11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants