You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem of fallback props is that it forces developers to render the fallback page at the same level as RealmProvider.
Let me give you a more concrete situation.
I'm using @react-navigation/native. This library provides components like Navigator and Screen which help us deal with native pages.
In my code, RealmProvider is outside of the Navigator.
When the Realm instance is under loading, <Stack.Navigator> get unmounted and it causes ugly blinks on the screen.
To avoid this behavior, we should keep <Stack.Navigator> mounted but it can't be achievable with the current design of RealmProvider.
So, my suggestion is
remove fallback props of RealmProvider
let the hooks(useQuery, useObject, etc) get suspended while the Realm instance is loading
Developers can put the custom loading with Suspense component anywhere inside <Stack.Navigator>.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
The problem of
fallback
props is that it forces developers to render the fallback page at the same level asRealmProvider
.Let me give you a more concrete situation.
I'm using @react-navigation/native. This library provides components like
Navigator
andScreen
which help us deal with native pages.In my code,
RealmProvider
is outside of theNavigator
.When the Realm instance is under loading,
<Stack.Navigator>
get unmounted and it causes ugly blinks on the screen.To avoid this behavior, we should keep
<Stack.Navigator>
mounted but it can't be achievable with the current design ofRealmProvider
.So, my suggestion is
fallback
props ofRealmProvider
useQuery
,useObject
, etc) get suspended while the Realm instance is loadingSuspense
component anywhere inside<Stack.Navigator>
.Beta Was this translation helpful? Give feedback.
All reactions