router: useNavigate doesn't go to the new url

Describe the bug When navigating with useNavigate() hook, the page doesn’t load the new route unless I manually reload the browser window.

To Reproduce Inside any app using @tanstack/react-location@3.5.0

import {useNavigate} from '@tanstack/react-location';
const navigate = useNavigate();

// Any attempt to trigger navigate from a user action, 
// say a button click like below
navigate({to: '/new-route'})

// the URL in the browser changes
//  but the new location doesn't load.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 3
  • Comments: 18

Most upvoted comments

All should be fixed in the new “Router”.

Hey all! I noticed a similar behavior while testing this package. I’m using create-react-app, I noticed whenever I update a file that contains a route loader and after fast-refresh is triggered, all the react-location links in the page would stop working (the URL would get updates, but the page content remains the same).