new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Expo · Router · all subjects

navigation/redirects

5 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Redirect component for immediate route replacement

The Redirect component from 'expo-router' immediately redirects to another route from a page or layout, functioning like the replace imperative navigation function. It navigates to the new route without rendering the current page. Usage: <Redirect href='/about' />

Deep linking works for every page in Expo Router

Deep links always work for every page in Expo Router, making it possible to share links to any content in the app. This is useful for promoting the app, collecting bug reports, E2E testing, and automating screenshots.

Use redirects for initialState replacement

In Expo Router, you can rehydrate application state from a route string (for example, /user/evanbacon) using redirects. It is recommended to avoid using initialState patterns in favor of deep linking (for example, a user opening the app to /profile rather than from the home screen). This is more analogous to the web and prevents app crashes if a particular screen causes issues.

Linking configuration is automatically constructed from app directory

The NavigationContainer's linking prop is automatically constructed based on the files in the app directory. You do not need to manually configure linking.

Redirect component for authentication guards

The Redirect component immediately redirects from a screen to a different URL. Import Redirect from 'expo-router'. Use it in the component's return statement with the href prop set to the target URL. This is useful for authentication checks: if a user is not logged in, return <Redirect href="/login" /> to send them to the login screen.

Give your agent this brain