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