Skip to main content
InterviewHubPRO
Section Overview
Q26

Question 26 of 50

Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)

52%
React Native & Expo (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)

What is the difference between Threading in React Native?

senior LevelCode Examplereact-nativeAdvanced Internals

In Simple Words: A React Native app runs on 4 primary threads:

  1. JavaScript Thread: Executes your business logic, React rendering, API calls, and state management.
  2. UI Thread (Main Thread): Android/iOS OS thread responsible for drawing views and handling user touch interactions.
  3. Shadow Thread: Background C++ thread where the Yoga layout engine computes layout coordinates before passing to UI thread.
  4. Native Modules Thread: Background thread pool where native platform modules execute tasks (e.g. Geolocation, File system).
text
React Native Threading Model:
[JS Thread (React Code)] ──► [Shadow Thread (Yoga C++ Layout)]
                                      │
                                      ▼
[Native Thread (Background Tasks)] ──► [UI / Main Thread (Native OS Drawing)]