(id: number)
| 75 | ) |
| 76 | } |
| 77 | |
| 78 | const getPostById = async (id: number): Promise<Post> => { |
| 79 | const response = await fetch( |
| 80 | `https://jsonplaceholder.typicode.com/posts/${id}`, |
| 81 | ) |
| 82 | return await response.json() |
| 83 | } |
| 84 | |
| 85 | function usePost(postId: number) { |