MCPcopy Create free account
hub / github.com/TanStack/router / PostsComponent

Function PostsComponent

e2e/solid-start/basic-solid-query/src/routes/posts.tsx:14–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12})
13
14function PostsComponent() {
15 const postsQuery = useQuery(() => postsQueryOptions())
16
17 return (
18 <div class="p-2 flex gap-2">
19 <ul class="list-disc pl-4">
20 <Suspense fallback={<div>Loading posts...</div>}>
21 <For
22 each={[
23 ...(postsQuery.data || []),
24 { id: 'i-do-not-exist', title: 'Non-existent Post' },
25 ]}
26 >
27 {(post) => (
28 <li class="whitespace-nowrap">
29 <Link
30 to="/posts/$postId"
31 params={{
32 postId: post.id,
33 }}
34 class="block py-1 text-blue-800 hover:text-blue-600"
35 activeProps={{ class: 'text-black font-bold' }}
36 >
37 <div>{post.title.substring(0, 20)}</div>
38 </Link>
39 </li>
40 )}
41 </For>
42 </Suspense>
43 </ul>
44 <hr />
45 <Outlet />
46 </div>
47 )
48}

Callers

nothing calls this directly

Calls 1

postsQueryOptionsFunction · 0.90

Tested by

no test coverage detected