#Wrapping the whole app with suspense

15 messages · Page 1 of 1 (latest)

hardy hemlock
#

I'm using the latest version with app router

Is there any negative sides to wrapping the whole app in layout.tsx with Suspense?

thanks

desert lichenBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

limpid socket
desert lichenBOT
#
✅ Success!

This question has been marked as answered! If you have any other questions, feel free to create another post

Jump to answer
hardy hemlock
#

thank you!

brave onyx
limpid socket
#

ideally you would have more suspense inside of it

brave onyx
#

Or does it only show the fallback until the async operations that create the React element immediately inside the Suspense element finish and the element renders?

limpid socket
#

it would suspend until all of the api calls that aren't wrapped in another suspense are completed

#

but the alternative is a blank white screen

#

so this is better

#

very much depends on your personal use case though

brave onyx
#

Ah okay so it's not all descendants of the top level <Suspense>. It's all descendants until we find another <Suspense> boundary.

limpid socket
#

yes

#

iirc it will waterfall suspense boundaries though