I'm trying to use React Suspense within a Next project
I'm not using SSR, the app is only used as client rendering
Supense works, but I got this error :
Fallback data is required when using suspense in SSR.
<Suspense fallback={<Skeleton />}>
<Foo />
</Suspense>
export const Foo = () => {
const { data, error, isLoading } = useSWR(
`/api/foo`,
async (url: string) => await ApiClient.GET(url),
{ suspense: true }
)
return <Bar data={data} />
}
I also am facing this.
However, from this section of the documentation I believe that it is ignorable in our cases. https://swr.vercel.app/docs/suspense#server-side-rendering
It appears to be triggering that error during the 'pre-rendering' stage.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With