How to redirect expo router to a folder in app load (for logged in users)
In my React Native app I use Expo routing and with the global session management, I have the below _layout.tsx file which simply checks if the user is logged in, then redirect to other folders if not, redirects to the login screen.
Conditional Rendering Issue with Redirects in React Native Expo using useContext
I have a simple app with an index.tsx file and a layout under /app. I also have an auth context. If I leave both redirects here in index.tsx, the console log always gives me null and rendering happens only once. Otherwise, if I remove them, I get the log even when it succeeds and the user is loaded.