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

Function PostsLayoutComponent

examples/solid/basic/src/posts.lazy.tsx:7–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5})
6
7function PostsLayoutComponent() {
8 const posts = Route.useLoaderData()
9
10 return (
11 <div class="p-2 flex gap-2">
12 <ul class="list-disc pl-4">
13 {[...posts(), { id: 'i-do-not-exist', title: 'Non-existent Post' }].map(
14 (post) => {
15 return (
16 <li class="whitespace-nowrap">
17 <Link
18 to="/posts/$postId"
19 params={{
20 postId: post.id,
21 }}
22 class="block py-1 px-2 text-blue-600 hover:opacity-75"
23 activeProps={{ class: 'font-bold underline' }}
24 >
25 <div>{post.title.substring(0, 20)}</div>
26 </Link>
27 </li>
28 )
29 },
30 )}
31 </ul>
32 <Outlet />
33 </div>
34 )
35}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected