React Suspense with Next.Js

469 Views Asked by At

React Suspense does not working with Next.JS(i used a skeleton from shadcn/ui as a fallback)

when image is loading, there are no any skeleton shadcn/ui is wrapper of radix ui

i tried to use to set position absoloute and z-10 to skeleton, but it does not help

1

There are 1 best solutions below

0
On

You should provide us with more information to handle your problem. Based on my experience with suspense, probably your problems have caused by one of these.

  • make sure data fetching placed under the suspense provider
  • if you use swr or react-query turn on suspense option
  • if css seems to be the problem, consider using create portal of React