T
TanStack3y ago
probable-pink

When navigating, the URL updates, but the outlet doesn't render. On page reload, it works.

Apologies if this has been asked before: please send the link if that is the case. I am using dynamic / lazy loading for my routes. When I use a Link, Navigate, or the useNavigate hook, the URL will update to the expected route, but the outlet does not render the content. When I manually reload the page, it loads as expected.
// Router
[
{
path: 'firstPage',
element: async () => {
return import(`./pages/firstPage/index.ts`).then(
(module: any) => <module.default />
);
},
},
{
path: 'secondPage',
element: async () => {
return import(`./pages/secondPage/index.ts`).then(
(module: any) => <module.default />
);
},
},
]
// Router
[
{
path: 'firstPage',
element: async () => {
return import(`./pages/firstPage/index.ts`).then(
(module: any) => <module.default />
);
},
},
{
path: 'secondPage',
element: async () => {
return import(`./pages/secondPage/index.ts`).then(
(module: any) => <module.default />
);
},
},
]
// Link
<Link to={'/firstPage'}>Go</Link>
// Link
<Link to={'/firstPage'}>Go</Link>
5 Replies
like-gold
like-gold3y ago
I have the exact same issue Did you manage to fix it?
extended-salmon
extended-salmon3y ago
Any updates? I am also having this issue on the latest version Oh, I just tried downgrading a few versions and it seems like version 0.0.1-beta.86 does not have this issue. The main functions and components are unchanged, so we can use this for now, but this should defenitely be fixed
equal-aqua
equal-aqua3y ago
extended-salmon
extended-salmon3y ago
Oh, awesome, thanks
eastern-cyan
eastern-cyan3y ago
It’s fixed and released now

Did you find this page helpful?