-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Closed
Labels
Description
What version of React Router are you using?
v6.19.0
React version: v18.2.0
Steps to Reproduce
The user will access the page with url like '..../place/claim?...'
and the page have following code:
useEffect(() => {
const getProfile = async () => {
// api call getting stuff
navigate('/place', { replace: true })
}
getProfile()
}, [...])
However, the navigate never works here
tried following as well:
const [shouldNavigate, setShouldNavigate] = useState(false);
useEffect(() => {
const getProfile = async () => {
// api call getting stuff
setShouldNavigate(true);
}
getProfile()
}, [...])
if (shouldNavigate) {
return (<Navigate to='/place' replace={true} />)
}
also doesn't redirect
Expected Behavior
url redirect to the /place
Actual Behavior
Nothing happens