Skip to content

Commit

Permalink
Move suspense boundary in test to better reflect recommended usage
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Oct 19, 2023
1 parent 5e7a5d2 commit 40ceea6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/react/hooks/__tests__/useInteractiveQuery.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1634,9 +1634,7 @@ it("works with startTransition to change variables", async () => {
function App() {
return (
<ApolloProvider client={client}>
<Suspense fallback={<SuspenseFallback />}>
<Parent />
</Suspense>
<Parent />
</ApolloProvider>
);
}
Expand All @@ -1651,9 +1649,11 @@ it("works with startTransition to change variables", async () => {
return (
<div>
<button onClick={() => loadQuery({ id: "1" })}>Load first todo</button>
{queryRef && (
<Todo queryRef={queryRef} onChange={(id) => loadQuery({ id })} />
)}
<Suspense fallback={<SuspenseFallback />}>
{queryRef && (
<Todo queryRef={queryRef} onChange={(id) => loadQuery({ id })} />
)}
</Suspense>
</div>
);
}
Expand Down

0 comments on commit 40ceea6

Please sign in to comment.