T
TanStack2y ago
extended-salmon

useNavgate ignore basepath

I updated from 1.17.4 to 1.19.1 and found this behavior) Steps to Reproduce: 1. Go to about page 2. Click to button https://stackblitz.com/edit/tanstack-router-g6pvet?file=src%2Fmain.tsx
19 Replies
deep-jade
deep-jade2y ago
did this work in 1.17.4?
extended-salmon
extended-salmonOP2y ago
@Manuel Schiller yes
deep-jade
deep-jade2y ago
can you find out which version introduced this issue? by trying out a few versions
extended-salmon
extended-salmonOP2y ago
Yes, I'll take a look now
deep-jade
deep-jade2y ago
1.18.4 had lots of changes, so maybe this introduced the regression.
extended-salmon
extended-salmonOP2y ago
yes, 1.18.4 changed the behavior
deep-jade
deep-jade2y ago
@Tanner Linsley I guess this was not intended ?
deep-jade
deep-jade2y ago
your reproducer had an error, I fixed this but the original issue still persists https://stackblitz.com/edit/tanstack-router-nwpm5t?file=src%2Froutes%2Fabout.tsx
Manuel Schiller
StackBlitz
Router Quickstart File Based Example (forked) - StackBlitz
Run official live example code for Router Quickstart File Based, created by Tanstack on StackBlitz
deep-jade
deep-jade2y ago
the basepath works if you explicitly set the to:
navigate({
to: '/about',
search: (prev) => ({
count: prev.count + 1,
}),
});
navigate({
to: '/about',
search: (prev) => ({
count: prev.count + 1,
}),
});
deep-jade
deep-jade2y ago
Manuel Schiller
StackBlitz
Router Quickstart File Based Example (forked) - StackBlitz
Run official live example code for Router Quickstart File Based, created by Tanstack on StackBlitz
extended-salmon
extended-salmonOP2y ago
Oh, I didn't even think about it, it's a good workaround, thanks)
deep-jade
deep-jade2y ago
can you please create a github issue with all the information so this does not get lost? ideally, the to does not have to be set
deep-jade
deep-jade2y ago
GitHub
fix: ssr improvements (#1248) · TanStack/router@3b559fc
* fix: ssr improvements * fix: remove log * fix: remove log * fix: remove comments * docs: root abstraction * fix: remove commented code * fix: remove old TLoaderData fix attempt ...
extended-salmon
extended-salmonOP2y ago
I'll do it today)
extended-salmon
extended-salmonOP2y ago
GitHub
useNavgate ignore basepath after 1.18.4 · Issue #1273 · TanStack/ro...
Describe the bug I updated from 1.17.4 to 1.19.1 and found this behavior) after navigate without from options router delete basepath from url. Your Example Website or App https://stackblitz.com/edi...
extended-salmon
extended-salmonOP2y ago
deep-jade
deep-jade2y ago
@Tanner Linsley can you please review this PR? since you changed the behavior here, you might know whether maybe there is more to be done than that FYI: you need to run pnpm prettier:write to auto fix the formatting
extended-salmon
extended-salmonOP2y ago
I saw it, thanks, I'm already launching it)
robust-apricot
robust-apricot2y ago
Looks like it should fix it Go for it.

Did you find this page helpful?