File tree 1 file changed +9
-8
lines changed
1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -129,20 +129,21 @@ export default function App() {
129
129
function Example() {
130
130
// ❌ react version -- supports destructing outside reactive context
131
131
// 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
+ // ),
136
137
// })
137
138
138
139
// ✅ solid version -- does not support destructuring outside reactive context
139
- const query = createQuery ({
140
- queryKey : () => [' repoData' ],
140
+ const query = createQuery (() => ( {
141
+ queryKey: [' repoData' ],
141
142
queryFn : () =>
142
143
fetch (' https://api.github.com/repos/tannerlinsley/react-query' ).then (
143
- (res ) => res .json (),
144
+ (res ) => res .json ()
144
145
),
145
- })
146
+ }))
146
147
147
148
// ✅ access query properties in JSX reactive context
148
149
return (
You can’t perform that action at this time.
0 commit comments