Replies: 3 comments
-
I tried it the tsx-way and it is ok.
|
Beta Was this translation helpful? Give feedback.
-
Examples: JSX-bases (ok): https://playcode.io/1335544 Config based (not work): https://playcode.io/1335586 |
Beta Was this translation helpful? Give feedback.
-
I'm also experiencing an issue with the config router using children property. I'm using an absolute path for the base in Vite so my prod build works but I've also tried relative with no luck. In my case, the nested route in the I would love for that to work but as a workaround you can define the children as top level with the full path name: // Working for me
{
path: "/:entity",
component: lazy(() => import("./pages/Profile")),
},
{
path: "/:entity/reports",
component: lazy(() => import("./pages/Profile/UserReports")),
},
{
path: "/:entity/projects",
component: lazy(() => import("./pages/Profile/UserProjects")),
},
// Broken
{
path: "/:entity",
component: lazy(() => import("./pages/Profile")),
children: [
{
path: "/reports",
component: lazy(() => import("./pages/Profile/UserReports")),
},
{
path: "/projects",
component: lazy(() => import("./pages/Profile/UserProjects")),
},
]
}
|
Beta Was this translation helpful? Give feedback.
-
I misunderstand something, or have a problem in my code, or does this not work with config based routing?
Simple example:
Output when you view
/
Output when you view
/page
Expected output when you click
link to content
or open route/page/content
in the browser urlBut Content from is not visible.
app.tsx
page.tsx
I can view page
/
I can view
/page
I see
link to content
When i click
link to content
the url changes to/page/content
I see still
link to content
But no content is visible
What i am doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions