Replies: 1 comment 15 replies
-
Yes, if you don't want to use Suspense you can use |
Beta Was this translation helpful? Give feedback.
15 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all!
I'm using an async selector that fetches a fair amount of data, it takes about 2-4 seconds on my phone. This is called on the app start, and it feels like the entire app freezes because nothing gets rendered during that time.
I tried debugging this to find out what part of Recoil might have performance issues and blocks the entire JS thread, and one thing was particularily interesting to me was: My async selector always returns a value, it's never
undefined
.So I browsed the Recoil documentation only to find out that Recoil is designed with React.Suspense in mind, which might be the reason that my entire app looks like it freezes for a few seconds on app launch (and renders nothing).
I wonder if there is a way to not use React.Suspsense, and instead have a
defaultValue
(ofundefined
or[]
) for async selectors?Beta Was this translation helpful? Give feedback.
All reactions