Skip to content

Commit b96c5af

Browse files
author
Yuji Sugiura
authored
[docs(solid-query)] Fix API signature in overview.md
1 parent 3941ee1 commit b96c5af

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

docs/solid/overview.md

Lines changed: 9 additions & 8 deletions
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)