Skip to content

Commit

Permalink
fix: example
Browse files Browse the repository at this point in the history
  • Loading branch information
tannerlinsley committed Nov 16, 2022
1 parent 8476dc2 commit e9ba234
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions examples/react/basic-ssr-lite/src/routeConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ export const routeConfig = createRouteConfig().createChildren((createRoute) => [
path: 'posts',
component: Posts,
errorComponent: () => 'Oh crap!',
// loader: async () => {
// return {
// posts: await fetchPosts(),
// }
// },
loader: async () => {
return {
posts: await fetchPosts(),
}
},
// loader: {...}
}).createChildren((createRoute) => [
createRoute({ path: '/', component: PostsIndex }),
createRoute({
path: ':postId',
component: Post,
// loader: async ({ params: { postId } }) => {
// return {
// post: await fetchPostById(postId),
// }
// },
loader: async ({ params: { postId } }) => {
return {
post: await fetchPostById(postId),
}
},
// loader: {...}
}),
]),
Expand Down

0 comments on commit e9ba234

Please sign in to comment.