Skip to content

Commit 890c4b3

Browse files
committed
add example
1 parent fa652cd commit 890c4b3

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

examples/react/basic/src/main.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,14 @@ function PostComponent() {
123123
<h4 className="text-xl font-bold">{post.title}</h4>
124124
<hr className="opacity-20" />
125125
<div className="text-sm">{post.body}</div>
126+
127+
<Link
128+
to="/posts"
129+
preferBack
130+
className="py-1 px-2 rounded bg-green-600 text-white hover:opacity-90"
131+
>
132+
← Back to posts
133+
</Link>
126134
</div>
127135
)
128136
}

examples/react/basic/src/posts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const fetchPosts = async () => {
1313
await new Promise((r) => setTimeout(r, 500))
1414
return axios
1515
.get<Array<PostType>>('https://jsonplaceholder.typicode.com/posts')
16-
.then((r) => r.data.slice(0, 10))
16+
.then((r) => r.data.slice(0, 50))
1717
}
1818

1919
export const fetchPost = async (postId: string) => {

0 commit comments

Comments
 (0)