Here is the problem. SplashScreen freezes in production with eas build but with expo build it works correctly.
I have not had any problems locally and also not with eas build.
In production, with eas build, the SplashScreen is rendered and hidden without problems when the application starts, then the LogIn screen is rendered. Afterwards, when logging in indeed, the SplashScreen appears (I don't know why) and gets stuck there.
This is the App.js file. I think the problem is not here, because the initial SplashScreen is hidden when the LogIn screen is rendered.
SplashScreen.preventAutoHideAsync()
const App: FC = () => {
const [appIsReady, setAppIsReady] = useState(false)
useEffect(() => {
async function prepare() {
try {
await getFonts()
await setTokenFromStorage()
} catch (e) {
console.warn(e)
} finally {
setAppIsReady(true)
}
}
prepare()
}, [])
const onLayoutRootView = useCallback(async () => {
if (appIsReady) {
await SplashScreen.hideAsync()
}
}, [appIsReady])
useEffect(() => {
if (appIsReady) onLayoutRootView()
}, [appIsReady])
return appIsReady ? (
<Provider store={store}>
<ContextProvider>
<AppNavigator />
<Toast config={toastConfig} />
</ContextProvider>
</Provider>
) : null
}
export default App
I don't really know what files I should look at to inspect the problem, but I also don't understand why the app behavior is correct when I build with expo build but not with eas build.