React Native interview question · Most asked
How does navigation work with Expo Router?
Summary
Expo Router is file-based: files in the app/ directory become routes, _layout.tsx files define navigators (Stack, Tabs), (group) folders organise screens without changing URLs, and [param] files are dynamic routes.
Longer Answer
Navigate with <Link href="/contact/42"> or router.push(...); read params with useLocalSearchParams(). Because every screen has a URL, deep links (myapp://contact/42) and web URLs work without extra configuration once a scheme is set. Protected areas are implemented by a layout that redirects to sign-in when there's no session.
Key Points
- Files = routes; _layout = navigator.
- (groups) don't affect URLs; [id] captures params.
- Deep links come for free; params are strings.
Deep dive: Mobile Apps with React Native and Expo: Navigation with Expo Router
Explanation
What interviewers look for
Understanding file-based routing, dynamic segments and how deep links map to screens.
Follow-up questions
- How would you protect screens that require sign-in?
- How do you handle a deep link to a screen whose data isn't loaded?
More most-asked React Native questions
- What is React Native, and how does it differ from a hybrid (WebView) app?
- Explain the React Native threading model.
- What is the React Native New Architecture?
- When would you use FlatList instead of ScrollView, and how do you make long lists fast?
- Where should you store data on the device, and what should never go in AsyncStorage?
- How would you make a React Native app work offline?
- How do you handle authentication tokens in a mobile app?
- A screen in your React Native app is slow. How do you investigate and fix it?