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
I'm building a toy app with sheet-router and yo-yo, I have this route defined.
constrouter=sheetRouter({default: '/404'},[['/posts',postsComponent,['/new',newPostComponent],['/:post',postComponent,['/comments',commentsComponent]]],['/404',(params)=>html`<div>Oh no, path not found! ${JSON.stringify(params,null,2)}</div>`],])
With that I want the following behaviour
/posts/new: Render newPostComponent
/posts/132: Render postComponent with params.post = 132
What I'm actually getting is
/posts/new: Render newPostComponent
/posts/132: Render the default route with no params
I though that if some route is not found, it would evaluate if some other route would match, and only if no one matched the given path show the default route.
So, is my code right for what I'm trying to achieve? Or am I misunderstanding how the router resolve paths?
Thanks in advance.
The text was updated successfully, but these errors were encountered:
Hmmmmmm, yeah this might have been the case at some point, but the way wayfarer's internals are right now are quite complex as-is to be honest. I'd be open for a PR that adds this behavior in wayfarer, on the sole condition that we test it well - I think supporting this is definitely reasonable
I'm building a toy app with sheet-router and yo-yo, I have this route defined.
With that I want the following behaviour
/posts/new
: RendernewPostComponent
/posts/132
: RenderpostComponent
withparams.post = 132
What I'm actually getting is
/posts/new
: RendernewPostComponent
/posts/132
: Render the default route with no paramsI though that if some route is not found, it would evaluate if some other route would match, and only if no one matched the given path show the default route.
So, is my code right for what I'm trying to achieve? Or am I misunderstanding how the router resolve paths?
Thanks in advance.
The text was updated successfully, but these errors were encountered: