Skip to content

Commit 08eb80e

Browse files
committed
Move dogs to props in example to avoid call to useSuspenseQuery
1 parent c4f727c commit 08eb80e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

docs/source/data/suspense.mdx

+2-3
Original file line numberDiff line numberDiff line change
@@ -448,16 +448,15 @@ Starting with Apollo Client `3.9.0`, you can use `useLoadableQuery` to start loa
448448
Let's update our example to start loading the dog's details as a result of selecting from a dropdown.
449449

450450
```tsx
451-
function App() {
452-
const { data } = useSuspenseQuery(GET_DOGS_QUERY);
451+
function App({ dogs }) {
453452
const [queryRef, loadDog] = useLoadableQuery(GET_DOG_QUERY)
454453

455454
return (
456455
<>
457456
<select
458457
onChange={(e) => loadDog({ id: e.target.value })}
459458
>
460-
{data.dogs.map(({ id, name }) => (
459+
{dogs.map(({ id, name }) => (
461460
<option key={id} value={id}>
462461
{name}
463462
</option>

0 commit comments

Comments
 (0)