()
| 130 | } |
| 131 | |
| 132 | function App() { |
| 133 | const [postId, setPostId] = React.useState(-1) |
| 134 | |
| 135 | return ( |
| 136 | <PersistQueryClientProvider |
| 137 | client={queryClient} |
| 138 | persistOptions={{ persister }} |
| 139 | > |
| 140 | <p> |
| 141 | As you visit the posts below, you will notice them in a loading state |
| 142 | the first time you load them. However, after you return to this list and |
| 143 | click on any posts you have already visited again, you will see them |
| 144 | load instantly and background refresh right before your eyes!{' '} |
| 145 | <strong> |
| 146 | (You may need to throttle your network speed to simulate longer |
| 147 | loading sequences) |
| 148 | </strong> |
| 149 | </p> |
| 150 | {postId > -1 ? ( |
| 151 | <Post postId={postId} setPostId={setPostId} /> |
| 152 | ) : ( |
| 153 | <Posts setPostId={setPostId} /> |
| 154 | )} |
| 155 | <ReactQueryDevtools initialIsOpen /> |
| 156 | </PersistQueryClientProvider> |
| 157 | ) |
| 158 | } |
| 159 | |
| 160 | const rootElement = document.getElementById('root') |
| 161 | if (!rootElement) throw new Error('Missing #root element') |
nothing calls this directly
no outgoing calls
no test coverage detected