()
| 122 | )} |
| 123 | </div> |
| 124 | ) |
| 125 | } |
| 126 | function usePosts() { |
| 127 | return useQuery({ |
| 128 | queryKey: ['posts'], |
| 129 | queryFn: async (): Promise<Array<Post>> => { |
| 130 | const response = await fetch('https://jsonplaceholder.typicode.com/posts') |
| 131 | return await response.json() |
| 132 | }, |
| 133 | }) |
| 134 | } |
| 135 |