From b96c5afe301e5d7f07f80e005e9b23f305149f78 Mon Sep 17 00:00:00 2001 From: Yuji Sugiura Date: Fri, 26 May 2023 15:37:53 +0900 Subject: [PATCH] [docs(solid-query)] Fix API signature in overview.md --- docs/solid/overview.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/solid/overview.md b/docs/solid/overview.md index 0e74b3e331..99d904a363 100644 --- a/docs/solid/overview.md +++ b/docs/solid/overview.md @@ -129,20 +129,21 @@ export default function App() { function Example() { // ❌ react version -- supports destructing outside reactive context // const { isPending, error, data } = useQuery({ - // queryKey: ['repoData'], () => - // queryFn: fetch('https://api.github.com/repos/tannerlinsley/react-query').then(res => - // res.json() - // ) + // queryKey: ['repoData'], + // queryFn: () => + // fetch('https://api.github.com/repos/tannerlinsley/react-query').then( + // (res) => res.json() + // ), // }) // ✅ solid version -- does not support destructuring outside reactive context - const query = createQuery({ - queryKey: () => ['repoData'], + const query = createQuery(() => ({ + queryKey: ['repoData'], queryFn: () => fetch('https://api.github.com/repos/tannerlinsley/react-query').then( - (res) => res.json(), + (res) => res.json() ), - }) + })) // ✅ access query properties in JSX reactive context return (