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

Function App

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

Source from the content-addressed store, hash-verified

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