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