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'm currently using withRouter() to create a form wrapper to prevent navigation if the form has unsaved content. I'm using setRouteLeaveHook to do this, which I am getting from the router that withRouter gives me. Unfortunately setRouteLeaveHook needs the current route, which I don't think I can get from the router object I'm passed.
There are some other ways to get the route, but it would reduce complexity if withRouter/another function provided everything I needed.
The text was updated successfully, but these errors were encountered:
I'm currently using
withRouter()
to create a form wrapper to prevent navigation if the form has unsaved content. I'm usingsetRouteLeaveHook
to do this, which I am getting from therouter
thatwithRouter
gives me. UnfortunatelysetRouteLeaveHook
needs the current route, which I don't think I can get from the router object I'm passed.There are some other ways to get the route, but it would reduce complexity if withRouter/another function provided everything I needed.
The text was updated successfully, but these errors were encountered: