()
| 104 | } |
| 105 | |
| 106 | function App() { |
| 107 | const [postId, setPostId] = React.useState(-1) |
| 108 | |
| 109 | return ( |
| 110 | <PersistQueryClientProvider |
| 111 | client={queryClient} |
| 112 | persistOptions={{ persister }} |
| 113 | > |
| 114 | <p> |
| 115 | As you visit the posts below, you will notice them in a loading state |
| 116 | the first time you load them. However, after you return to this list and |
| 117 | click on any posts you have already visited again, you will see them |
| 118 | load instantly and background refresh right before your eyes!{' '} |
| 119 | <strong> |
| 120 | (You may need to throttle your network speed to simulate longer |
| 121 | loading sequences) |
| 122 | </strong> |
| 123 | </p> |
| 124 | {postId > -1 ? ( |
| 125 | <Post postId={postId} setPostId={setPostId} /> |
| 126 | ) : ( |
| 127 | <Posts setPostId={setPostId} /> |
| 128 | )} |
| 129 | <ReactQueryDevtools initialIsOpen /> |
| 130 | </PersistQueryClientProvider> |
| 131 | ) |
| 132 | } |
| 133 | |
| 134 | const rootElement = document.getElementById('root') |
| 135 | if (!rootElement) throw new Error('Missing #root element') |
nothing calls this directly
no outgoing calls
no test coverage detected