MCPcopy Create free account
hub / github.com/TanStack/query / App

Function App

examples/solid/basic/src/index.tsx:129–152  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

127}
128
129const App: Component = () => {
130 const [postId, setPostId] = createSignal(-1)
131
132 return (
133 <QueryClientProvider client={queryClient}>
134 <SolidQueryDevtools />
135 <p>
136 As you visit the posts below, you will notice them in a loading state
137 the first time you load them. However, after you return to this list and
138 click on any posts you have already visited again, you will see them
139 load instantly and background refresh right before your eyes!{' '}
140 <strong>
141 (You may need to throttle your network speed to simulate longer
142 loading sequences)
143 </strong>
144 </p>
145 {postId() > -1 ? (
146 <Post postId={postId()} setPostId={setPostId} />
147 ) : (
148 <Posts setPostId={setPostId} />
149 )}
150 </QueryClientProvider>
151 )
152}
153
154const root = document.getElementById('root')
155if (!root) throw new Error('Missing #root element')

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected