What is the difference between React Native and React?
Why Interviewers Ask This
Interviewers use this question to quickly assess whether a candidate has the foundational knowledge required for React Native development. It reveals whether you understand the building blocks that more complex concepts rely on.
Answer
React is a JavaScript library for building web user interfaces — it renders to the browser DOM. React Native uses the same React paradigm (components, hooks, state, props, JSX) but renders to native mobile UI instead of the browser DOM. Key similarities: component-based architecture, JSX syntax, hooks (useState, useEffect, useContext, useCallback, useMemo), props and state, same JavaScript, same Redux/Zustand/Recoil state management libraries, same testing patterns. Key differences: (1) No HTML tags: React Native uses View instead of div, Text instead of p/span/h1, Image instead of img, TextInput instead of input; (2) No CSS: React Native uses a JavaScript-based StyleSheet API. Subset of CSS — Flexbox (default), no grid, no CSS cascade; (3) No browser APIs: no window, document, localStorage. Use AsyncStorage, platform APIs; (4) Platform-specific code: some components/APIs differ per platform (iOS vs Android). Use Platform.OS or .ios.js/.android.js file extensions; (5) Navigation: browser has built-in URL routing; React Native needs a library (React Navigation, Expo Router); (6) Performance model: React targets 60fps DOM updates; React Native targets 60fps native rendering across a JS-native bridge. Code that's valid in one is NOT automatically valid in the other.
Common Mistake
Many candidates answer correctly but can't explain the 'why'. Always be prepared to justify your answer with a concrete example or use case from your React Native experience.