Cold start is the one piece of an app that every single user experiences, in full, before they experience anything else. Munchable's version of it is five lines, and the interesting thing about those five lines is not what they wait for. It is what they are not allowed to do.
const [ fontsLoaded , fontError ] = useFonts ( fontMap ); const hydrated = useProfile (( s ) => s . hydrated ); const taxonomyHydrated = useTaxonomy (( s ) => s . hydrated ); const ready = ( fontsLoaded || !! fontError ) && hydrated && taxonomyHydrated ;
if ( ! ready ) return null ;
Enter fullscreen mode
Exit fullscreen mode
With SplashScreen.preventAutoHideAsync() called at module scope and hideAsync() fired in an effect once ready turns true, the return null is never visible. The splash stays up, and the first thing drawn is a finished screen.
The rule I hold myself to is that every one of those three conditions has to be a promise that cannot reject. Not "should not". Cannot.…