()
| 33 | }) |
| 34 | |
| 35 | function App() { |
| 36 | const [postId, setPostId] = React.useState(-1) |
| 37 | |
| 38 | return ( |
| 39 | <QueryClientProvider client={queryClient}> |
| 40 | <p> |
| 41 | As you visit the posts below, you will notice them in a loading state |
| 42 | the first time you load them. However, after you return to this list and |
| 43 | click on any posts you have already visited again, you will see them |
| 44 | load instantly and background refresh right before your eyes!{' '} |
| 45 | <strong> |
| 46 | (You may need to throttle your network speed to simulate longer |
| 47 | loading sequences) |
| 48 | </strong> |
| 49 | </p> |
| 50 | {postId > -1 ? ( |
| 51 | <Post postId={postId} setPostId={setPostId} /> |
| 52 | ) : ( |
| 53 | <Posts setPostId={setPostId} /> |
| 54 | )} |
| 55 | <ReactQueryDevtools initialIsOpen /> |
| 56 | </QueryClientProvider> |
| 57 | ) |
| 58 | } |
| 59 | |
| 60 | function Posts({ |
| 61 | setPostId, |
nothing calls this directly
no outgoing calls
no test coverage detected