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

Function App

examples/solid/default-query-function/src/index.tsx:33–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31})
32
33function App() {
34 const [postId, setPostId] = createSignal(-1)
35
36 return (
37 <QueryClientProvider client={queryClient}>
38 <SolidQueryDevtools />
39 <p>
40 As you visit the posts below, you will notice them in a loading state
41 the first time you load them. However, after you return to this list and
42 click on any posts you have already visited again, you will see them
43 load instantly and background refresh right before your eyes!{' '}
44 <strong>
45 (You may need to throttle your network speed to simulate longer
46 loading sequences)
47 </strong>
48 </p>
49 <Show when={postId() > -1} fallback={<Posts setPostId={setPostId} />}>
50 <Post postId={postId()} setPostId={setPostId} />
51 </Show>
52 </QueryClientProvider>
53 )
54}
55
56function Posts(props: { setPostId: Setter<number> }) {
57 // All you have to do now is pass a key!

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected