File tree 1 file changed +10
-10
lines changed
examples/react/basic-ssr-lite/src
1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -18,22 +18,22 @@ export const routeConfig = createRouteConfig().createChildren((createRoute) => [
18
18
path : 'posts' ,
19
19
component : Posts ,
20
20
errorComponent : ( ) => 'Oh crap!' ,
21
- // loader: async () => {
22
- // return {
23
- // posts: await fetchPosts(),
24
- // }
25
- // },
21
+ loader : async ( ) => {
22
+ return {
23
+ posts : await fetchPosts ( ) ,
24
+ }
25
+ } ,
26
26
// loader: {...}
27
27
} ) . createChildren ( ( createRoute ) => [
28
28
createRoute ( { path : '/' , component : PostsIndex } ) ,
29
29
createRoute ( {
30
30
path : ':postId' ,
31
31
component : Post ,
32
- // loader: async ({ params: { postId } }) => {
33
- // return {
34
- // post: await fetchPostById(postId),
35
- // }
36
- // },
32
+ loader : async ( { params : { postId } } ) => {
33
+ return {
34
+ post : await fetchPostById ( postId ) ,
35
+ }
36
+ } ,
37
37
// loader: {...}
38
38
} ) ,
39
39
] ) ,
You can’t perform that action at this time.
0 commit comments