Skip to content

Commit bc50f45

Browse files
Merge branch 'main' into batch-rewrite
2 parents fdb0e56 + 1f0d66b commit bc50f45

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/routes/reference/basic-reactivity/create-resource.mdx

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ There are two ways to use `createResource`: you can pass the fetcher function as
88
The source signal will retrigger the fetcher whenever it changes, and its value will be passed to the fetcher.
99

1010
```tsx
11-
const [data, { mutate, refetch, state }] = createResource(fetchData)
11+
const [data, { mutate, refetch }] = createResource(fetchData)
1212
```
1313

1414
```tsx
15-
const [data, { mutate, refetch, state }] = createResource(source, fetchData)
15+
const [data, { mutate, refetch }] = createResource(source, fetchData)
1616
```
1717

1818
In these snippets, the fetcher is the function `fetchData`, and `data()` is undefined until `fetchData` finishes resolving.
@@ -49,7 +49,7 @@ async function fetchData(source, { value, refetching }) {
4949
// or equal to the optional data passed: `refetch(info)`
5050
}
5151

52-
const [data, { mutate, refetch, state }] = createResource(getQuery, fetchData)
52+
const [data, { mutate, refetch }] = createResource(getQuery, fetchData)
5353

5454
// read value
5555
data()
@@ -102,7 +102,7 @@ You can use the new `ssrLoadFrom` option for this.
102102
Instead of using the default `server` value, you can pass `initial` and the resource will use `initialValue` as if it were the result of the first fetch for both SSR and hydration.
103103

104104
```tsx
105-
const [data, { mutate, refetch, state }] = createResource(() => params.id, fetchUser, {
105+
const [data, { mutate, refetch }] = createResource(() => params.id, fetchUser, {
106106
initialValue: preloadedData,
107107
ssrLoadFrom: "initial",
108108
})

0 commit comments

Comments
 (0)