TanStackT
TanStack11mo ago
11 replies
opposite-copper

changing URL without triggering a navigation

I'm having a very hard time getting this to work:

- I have a route /chat where after I submit a form I'd like to update the URL to /chat/{id created client side} but NOT trigger a navigation to the /chat/{id} route

- In my form submission handler I've tried:
- window.replaceState
- useNavigate with replace: true

Neither of these things work. I still see the /chat/{id} loader + component get hit. Would really appreciate some help here!
Was this page helpful?