React Native interview question · Most asked
What are the app states in React Native, and what should you do on each transition?
Summary
AppState reports active, background and (on iOS) inactive. When leaving active, save state and pause timers, polling and media; when returning to active, refresh stale data and re-check the session and permissions.
Longer Answer
The OS can suspend or kill a backgrounded app without warning, so persist anything important on the way out. iOS inactive occurs for brief interruptions (app switcher, incoming call); don't treat it as signing out. Use transitions (previous → next), not just the current state.
Key Points
- active / background / inactive.
- Save on leave; refresh on return.
- Don't overreact to inactive.
Deep dive: Mobile Apps with React Native and Expo: How React Native Works
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?