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

Function Location

examples/solid/rick-morty-solid-router/src/Character.tsx:89–109  ·  view source on GitHub ↗
(props: { locationId: string })

Source from the content-addressed store, hash-verified

87}
88
89function Location(props: { locationId: string }) {
90 const query = useQuery(() => locationsQueries.detail(props.locationId))
91
92 return (
93 <Switch>
94 <Match when={query.status === 'pending'}>
95 <span>Loading...</span>
96 </Match>
97 <Match when={query.status === 'error'}>
98 <span>Error :(</span>
99 </Match>
100 <Match when={query.data}>
101 {(data) => (
102 <span>
103 {data().name} - {data().type}
104 </span>
105 )}
106 </Match>
107 </Switch>
108 )
109}
110
111export default Character

Callers

nothing calls this directly

Calls 1

useQueryFunction · 0.90

Tested by

no test coverage detected