Skip to content
Source
Sign inSign up
TanStack/query

docs(solid-query): fix incorrect Vue.js code example in Suspense guide #9813

MergedVarunchandrashekar05(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/9813/headmerged by TkDodo View on GitHub

Showing 1 changed file with 11 additions and 12 deletions.

x
0 of 1 viewed, 1 left
11 additions and 12 deletionsdocs/framework/solid/guides/suspense.mdModified
View file
@@ -16,25 +16,24 @@
​
You can use async `suspense` function that is provided by `solid-query`.
​
-```vue
-<script>
-import { defineComponent } from 'vue'
+```tsx
import { useQuery } from '@tanstack/solid-query'
​
const todoFetcher = async () =>
await fetch('https://jsonplaceholder.cypress.io/todos').then((response) =>
response.json(),
-export default defineComponent({
- name: 'SuspendableComponent',
- async setup() {
- const { data, suspense } = useQuery(() => ['todos'], todoFetcher)
- await suspense()
​
- return { data }
- },
-})
-</script>
+function SuspendableComponent() {
+ const query = useQuery(() => ({