How do I show the index page when there are no route params?
I want to setup something like this:
/posts -> index
/posts/1 -> show
My issue is, I am unsure how to setup my
<Outlet />
3 Replies
xenial-black•3y ago
I'm making assumptions, but I'm assuming you want to show them as two separate pages and there is little to no overlap on UI.
I think you can do something like this
If there is overlapping UI then you can create a component for
postsRootRoute and put the outlet in there where you'd want it (ie. after common Nav/contextual UI)ambitious-aquaOP•3y ago
Ah okay, this looks like what I was looking for! Thank you!
Looks like I am getting
Invariant failed
It doesn't like the path: '' line
@Bryant It works if i change path: '' to path: '/'xenial-black•3y ago
Glad to hear it worked!