const Posts = () => {
...
return <>
{posts.map(post => <Post post={posts} />)}
{/* Where do I put the outlet? I only want the Posts or the Single post to show */}
</>
}
export const postsRoute = new Route({
getParentRoute: () => rootRoute,
path: '/posts',
component: Posts,
})
export const postRoute = new Route({
getParentRoute: () => postsRoute,
path: '$postId',
component: Post,
})
const routeTree = rootRoute.addChildren([
indexRoute,
postsRoute.addChildren([postRoute]),
])
const Posts = () => {
...
return <>
{posts.map(post => <Post post={posts} />)}
{/* Where do I put the outlet? I only want the Posts or the Single post to show */}
</>
}
export const postsRoute = new Route({
getParentRoute: () => rootRoute,
path: '/posts',
component: Posts,
})
export const postRoute = new Route({
getParentRoute: () => postsRoute,
path: '$postId',
component: Post,
})
const routeTree = rootRoute.addChildren([
indexRoute,
postsRoute.addChildren([postRoute]),
])