Skip to content

Commit

Permalink
Fix wrong # redirection
Browse files Browse the repository at this point in the history
  • Loading branch information
charlescd committed Feb 27, 2025
1 parent 9d38bd0 commit d9479d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/RedirectHashRouterToBrowserRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ export const RedirectHashRouterToBrowserRouter = () => {
const location = useLocation()

useEffect(() => {
if (location.hash.startsWith('#/')) {
if (location.href.startsWith('/#/')) {
// Navigate to the new path without the hash.
navigate({ to: location.hash.replace('#', '') })
navigate({ to: location.href.replace('/#', '') })
}
}, [location, navigate])

Expand Down

0 comments on commit d9479d5

Please sign in to comment.