Skip to content

Commit 210e4c7

Browse files
author
Yuji Sugiura
authored
docs(solid-query): Fix API signature in overview.md (#5470)
1 parent 91f4a6b commit 210e4c7

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

docs/solid/overview.md

+9-8
Original file line numberDiff line numberDiff line change
@@ -129,20 +129,21 @@ export default function App() {
129129
function Example() {
130130
// ❌ react version -- supports destructing outside reactive context
131131
// const { isPending, error, data } = useQuery({
132-
// queryKey: ['repoData'], () =>
133-
// queryFn: fetch('https://api.github.com/repos/tannerlinsley/react-query').then(res =>
134-
// res.json()
135-
// )
132+
// queryKey: ['repoData'],
133+
// queryFn: () =>
134+
// fetch('https://api.github.com/repos/tannerlinsley/react-query').then(
135+
// (res) => res.json()
136+
// ),
136137
// })
137138

138139
// ✅ solid version -- does not support destructuring outside reactive context
139-
const query = createQuery({
140-
queryKey: () => ['repoData'],
140+
const query = createQuery(() => ({
141+
queryKey: ['repoData'],
141142
queryFn: () =>
142143
fetch('https://api.github.com/repos/tannerlinsley/react-query').then(
143-
(res) => res.json(),
144+
(res) => res.json()
144145
),
145-
})
146+
}))
146147

147148
// ✅ access query properties in JSX reactive context
148149
return (

0 commit comments

Comments
 (0)