React Native interview question · Most asked
Explain the React Native threading model.
Summary
Your React code runs on the JavaScript thread; native views are drawn and touches arrive on the main (UI) thread; layout and native modules can use background threads. A blocked JS thread delays taps and JS-driven updates.
Longer Answer
Smoothness means finishing each frame in about 16 ms (60 fps). Long synchronous work on the JS thread (parsing huge JSON, heavy loops) delays event handlers and state updates, so the UI feels frozen even though native scrolling can continue. Keep heavy work off interaction paths, move animations to the UI thread (Reanimated or the native driver), and defer non-urgent work.
Key Points
- JS thread: React and business logic.
- UI thread: native rendering and input.
- Keep the JS thread free during interactions; run animations on the UI thread.
Deep dive: Mobile Apps with React Native and Expo: How React Native Works
Explanation
What interviewers look for
Understanding why JS-thread work causes dropped frames and how animations avoid it.
Follow-up questions
- How would you diagnose a laggy screen?
- Why do Reanimated animations stay smooth when JS is busy?
More most-asked React Native questions
- What is React Native, and how does it differ from a hybrid (WebView) app?
- 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?
- What can be shipped with an over-the-air (OTA) update, and what can't?