From 210e4c7781ed90e156ec2088559d6965687d1d04 Mon Sep 17 00:00:00 2001 From: Yuji Sugiura Date: Sat, 27 May 2023 14:59:25 +0900 Subject: [PATCH] docs(solid-query): Fix API signature in overview.md (#5470) --- 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 (