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} />
}