Mirror: The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore(next): warn for missing suspense boundary (#3449)

authored by

Jovi De Croock and committed by
GitHub
fa692c1c f39165d8

+23 -1
+5
.changeset/small-rings-drop.md
··· 1 + --- 2 + '@urql/next': patch 3 + --- 4 + 5 + Show a warning when the `Suspense` boundary is missing under the UrqlProvider
+18 -1
packages/next-urql/src/Provider.ts
··· 9 9 undefined 10 10 ); 11 11 12 + const SuspenseWarning = () => { 13 + if (process.env.NODE_ENV !== 'production') { 14 + console.warn( 15 + 'urql suspended but there was no boundary to catch it, add a <Suspense> component under your urql Provider.' 16 + ); 17 + } 18 + return null; 19 + }; 20 + 12 21 /** Provider for `@urql/next` during non-rsc interactions. 13 22 * 14 23 * @remarks ··· 59 68 React.createElement( 60 69 SSRContext.Provider, 61 70 { value: ssr }, 62 - React.createElement(DataHydrationContextProvider, { nonce }, children) 71 + React.createElement( 72 + DataHydrationContextProvider, 73 + { nonce }, 74 + React.createElement( 75 + React.Suspense, 76 + { fallback: React.createElement(SuspenseWarning) }, 77 + children 78 + ) 79 + ) 63 80 ) 64 81 ); 65 82 }