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

Function PostsComponent

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

Source from the content-addressed store, hash-verified

16})
17
18function PostsComponent() {
19 const posts = Route.useLoaderData()
20
21 return (
22 <div class="p-2 flex gap-2">
23 <ul class="list-disc pl-4">
24 <For each={posts()}>
25 {(post) => {
26 return (
27 <li class="whitespace-nowrap">
28 <Link
29 to="/posts/$postId"
30 params={{
31 postId: post.id,
32 }}
33 class="block py-1 text-blue-800 hover:text-blue-600"
34 activeProps={{ class: 'text-black font-bold' }}
35 >
36 <div>{post.title.substring(0, 20)}</div>
37 </Link>
38 </li>
39 )
40 }}
41 </For>
42 </ul>
43 <hr />
44 <Outlet />
45 </div>
46 )
47}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected