Next.js Discord

Discord Forum

suspense next.js doesn't work

Unanswered
Mandarin fish posted this in #help-forum
Open in Discord
Mandarin fishOP
How to fix or how to use suspense
{guilds.map((guild) => (
                <Suspense fallback={<p className=' text-primary'>Loading</p>}>
                  <Link
                    href={server/${guild.id}}
                    className=' flex gap-3 p-3 rounded-xl group text-primary duration-150 ease-out hover:bg-transparent-con'
                    key={guild.id}>
                    <div></div>
                    <ChevronRight
                      className=' opacity-0 translate-x-[-5px] text-primary group-hover:translate-x-0 group-hover:opacity-100 duration-150 ease-in-out'
                      size={24}
                    />
                  </Link>
                </Suspense>
              ))}

6 Replies

this is not how Suspense works
@Ray this is not how Suspense works
Mandarin fishOP
suspense can work only with components?