You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can see the console message "navigate /dashboard" inside developer tools. However, page does not change. First I thought about it was a problem with IFrame, however, this function inside a button click correctly navigates the page.
I fixed the navigation problem with using return <Navigate to={routes.dashobard}/> and holding additional state for the if clause, but I am wondering why navigate function does not route inside the handler. Thanks for the help.
The text was updated successfully, but these errors were encountered:
melihcoban
changed the title
[Bug]: useNavigate function does not work inside iframe's event listener
[Bug]: useNavigate function does not work inside event listener (application is called within iframe)
Oct 1, 2024
Do you get any error on the console when this happens? My guess is security things around navigation event in a non-interaction context (a message that doesn't necessarily come from a click vs. the form handler is definitely from user input).
I don't know the details of the logic behind auth.authenticateThirdParty, but if this is async logic, wouldn't it cause navigate to run before authentication is complete, preventing the intended behavior?
This issue has been automatically closed because we haven't received a response from the original author 🙈. This automation helps keep the issue tracker clean from issues that aren't actionable. Please reach out if you have more information for us! 🙂
What version of React Router are you using?
6.26.2
Steps to Reproduce
Expected Behavior
I expect route to change as the function is called.
Actual Behavior
Application I am embedding inside uses React-Router-Dom 6.26.2 with an BrowserRouter.
This is how I use the navigate function
I can see the console message "navigate /dashboard" inside developer tools. However, page does not change. First I thought about it was a problem with IFrame, however, this function inside a button click correctly navigates the page.
I fixed the navigation problem with using
return <Navigate to={routes.dashobard}/>
and holding additional state for the if clause, but I am wondering why navigate function does not route inside the handler. Thanks for the help.The text was updated successfully, but these errors were encountered: