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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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
/pageExpected output when you click
link to contentor open route/page/contentin the browser urlBut Content from is not visible.
app.tsxpage.tsxI can view page
/I can view
/pageI see
link to contentWhen i click
link to contentthe url changes to/page/contentI see still
link to contentBut no content is visible
What i am doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions