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

Function App

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

Source from the content-addressed store, hash-verified

97}
98
99const App: Component = () => {
100 const [postId, setPostId] = createSignal(-1)
101
102 return (
103 <QueryClientProvider client={queryClient}>
104 <SolidQueryDevtools />
105 <p>
106 As you visit the posts below, you will notice them in a loading state
107 the first time you load them. However, after you return to this list and
108 click on any posts you have already visited again, you will see them
109 load instantly and background refresh right before your eyes!{' '}
110 <strong>
111 (You may need to throttle your network speed to simulate longer
112 loading sequences)
113 </strong>
114 </p>
115 {postId() > -1 ? (
116 <Post postId={postId()} setPostId={setPostId} />
117 ) : (
118 <Posts setPostId={setPostId} />
119 )}
120 </QueryClientProvider>
121 )
122}
123
124const root = document.getElementById('root')
125if (!root) throw new Error('Missing #root element')

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected