You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and i tested with the url snippets/abc/def/123
but it turned out that the splat field in the param in the loader was snippets/abc/def/123.
the parent path("snippets") was included, which i think is weird.
because the place where the splat was used is in the "snippets" path. i thought the splat should be like abc/def/123
To work it out, i needed to add "snippets" in the child path before the asterisk.
{path: 'snippets',children: [{index: true,element: <Snippets/>,loader: snippetsLoader,},{path: 'snippets/*',//this looks weird because i already have written 'snippets' at the parent path.element: <Snippet/>,loader: snippetContentsLoader,},],},
i think that this working code is not that straightforward and it might require us to write some duplicate strings if the parent has several child path.
i would like to listen to all your opinions. kindly add your comment.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
here's my routes working well.
i first tried the "snippets/*" path using just
path: "*"
.and i tested with the url
snippets/abc/def/123
but it turned out that the splat field in the param in the loader was
snippets/abc/def/123
.the parent path("snippets") was included, which i think is weird.
because the place where the splat was used is in the "snippets" path. i thought the splat should be like
abc/def/123
To work it out, i needed to add "snippets" in the child path before the asterisk.
i think that this working code is not that straightforward and it might require us to write some duplicate strings if the parent has several child path.
i would like to listen to all your opinions. kindly add your comment.
Beta Was this translation helpful? Give feedback.
All reactions