React Native
React Native renders native views from React code through JSI, the Fabric renderer and Hermes, so layout, lists and gestures behave unlike the web. Interviews probe where JavaScript stops.
on this pageshowhide
guide
overview
~2 minReact Native lets you build an app in React and TypeScript while the screen is made of real iOS and Android views rather than a web page in a wrapper. Interviewers probe the seam that design creates: which work runs in JavaScript and which in native code, what it costs to cross between them, and where the two platforms refuse to behave alike. A strong answer names the thread a piece of work runs on, the platform it differs on, and whether the claim holds for a debug build or a release one. The hub splits into four layers. The everyday surface is [Core UI Primitives](/topics/mob-react-native-components-apis), [Styles & Flexbox](/topics/mob-react-native-styling-layout), [Virtualized Lists](/topics/mob-react-native-lists), [Screen Navigation](/topics/mob-react-native-navigation) and [Gestures & Motion](/topics/mob-react-native-motion). Beneath it sit [Runtime Layers](/topics/mob-react-native-runtime) — threads, JSI, Fabric and Hermes — along with [Turbo Modules & Codegen](/topics/mob-react-native-native-modules-bridge) for shipping your own native code and [Platform-Specific Code](/topics/mob-react-native-platform-performance) for branching per OS. The app-level concerns are [App State & Data](/topics/mob-react-native-state-data), [Networking & Connectivity](/topics/mob-react-native-networking), [Deep Link Handling](/topics/mob-react-native-deep-linking), [Push Notification Handling](/topics/mob-react-native-push), [Mobile App Hardening](/topics/mob-react-native-security) and [Assistive Tech Support](/topics/mob-react-native-a11y). The engineering loop around all of it is [Project Setup](/topics/mob-react-native-setup), [Debugging & Dev Loop](/topics/mob-react-native-devloop), [Unit Test Setup](/topics/mob-react-native-testing), [Speed & Memory Tuning](/topics/mob-react-native-perf) and [Store Release](/topics/mob-react-native-release). Junior rounds test whether you still think in the DOM: where text may appear, which flexbox defaults changed, when a list must virtualize, why one permission prompt differs by OS. Senior and staff rounds turn into diagnosis and design — a screen that janks on low-end Android, a notification tap that does nothing from a killed app, a native module to specify, a secret someone shipped inside the bundle, a release build that behaves unlike debug. Start with the primitives and styling, because every later answer assumes you know what a native view is. Lists and navigation come next, since they shape every real screen. Learn the runtime before performance or native modules: neither makes sense until you can say which thread owns what.
primer
### Native views, not a DOM Every component you render ends up as a platform view: a `View` becomes a native container, `Text` a native text view. There is no document, no cascade, no selector and no browser layout engine. Styles are plain objects, layout is flexbox computed by **Yoga** with its own defaults, and text can only live inside `Text`. Most junior questions are really asking whether you notice where a web habit stops working. ### Two threads share one frame Your React code, state updates and event handlers run on the **JavaScript thread**; native views may be created and changed only on the **UI thread**, which also runs native scrolling and touch delivery. Each has roughly one frame's worth of time to do its part. Jank questions start with one move: decide which thread missed its budget, because the fixes for each look nothing alike. ### The boundary is typed and synchronous now The legacy bridge passed serialized messages between the two worlds asynchronously. The **New Architecture** replaces it with **JSI**, which lets JavaScript hold references to C++ objects and call them directly, the **Fabric** renderer, and **Turbo Modules** generated from a typed spec by **Codegen**. Interviewers use this layer to separate people who have used React Native from people who understand it. ### An app is a native binary plus a bundle Metro bundles your JavaScript; in release builds Hermes compiles that bundle to bytecode, and Xcode or Gradle packages it inside a signed native app. That split explains a cluster of answers: why native changes need a store release while JavaScript changes may not, why environment values are baked in at build time and therefore public, and why a debug build tells you little about release speed. ### The operating system owns the lifecycle The app is foregrounded, backgrounded, suspended and killed by the OS, not by your code. Push notifications, deep links, background work and persisted state all have to answer the same question: what state was the app in when this arrived? Cold start and warm start are separate paths, and forgetting one is the usual bug. ### Two platforms leak through One codebase does not mean one behaviour. Permissions, back navigation, keyboard handling, secure storage, link verification and signing all differ, and React Native gives you explicit ways to branch. Strong answers say which platform they mean instead of describing one and implying both. ### Do less work, then measure it Performance rests on two habits: mount only what the user can see, and re-render only what changed. Virtualized lists, memoized rows and animations that run off the JavaScript thread follow from them. Interviewers expect you to measure a release build, on real hardware, before changing anything.
- JavaScript thread
- The single thread that runs the app's bundle: React rendering, state updates, event handlers and timers. When it is busy, taps and JS-driven animations wait.
- UI thread
- The platform main thread, the only one that creates and changes native views. It also draws frames, runs native scrolling and receives raw touches.
- Yoga
- The cross-platform layout engine that computes flexbox for React Native views. Its defaults differ from CSS in several places web developers rely on.
- Density-independent point
- The unitless length used in React Native styles. The device's pixel ratio converts it to physical pixels, so a layout keeps its size across screens.
- JSI
- The JavaScript Interface: a C++ API that lets JavaScript hold references to native host objects and call their functions directly, without serializing messages.
- Legacy bridge
- The pre-New-Architecture channel that carried serialized, batched, asynchronous messages between JavaScript and native code.
- New Architecture
- The combination of JSI, the Fabric renderer and Turbo Modules that replaced the legacy bridge and the old renderer and native module system.
- Fabric
- React Native's current renderer. It builds the tree of views to display in C++, runs layout, and applies changes to the native view hierarchy.
- Turbo Module
- A native module described by a typed JavaScript spec and reached through JSI, loaded when first used rather than all at app start.
- Codegen
- The build-time tool that reads a typed module or component spec and generates the C++, Objective-C++ and Java or Kotlin interfaces native code implements.
- Hermes
- React Native's default JavaScript engine, built for mobile. Release builds ship its precompiled bytecode instead of JavaScript source.
- Metro
- React Native's JavaScript bundler and development server. It resolves platform-specific files, serves the bundle during development and produces it for release.
- Autolinking
- The build step that finds installed libraries containing native code and wires them into the iOS and Android projects without manual edits.
- Expo
- The framework the React Native docs recommend for new apps, bundling routing, native module packages, build tooling and upgrade support around React Native.
- Virtualized list
- A list that keeps only a window of rows around the viewport mounted, so memory and render cost stay bounded as data grows.
- Native driver
- An Animated option that sends an animation's description to native code before it starts, so frames are computed on the UI thread.
- Worklet
- A small function Reanimated runs on the UI thread's own JavaScript runtime, letting gestures and animations update views without a React render.
- Fast Refresh
- The development feature that swaps edited modules into the running app and keeps component state when it safely can.
- Deep link
- A URL that opens a specific screen of the app, through a custom scheme or a verified web domain, from either a cold or a warm start.
- Device token
- An opaque address issued by APNs on iOS or FCM on Android for one app installation, which the backend uses to target push notifications.
- Hydration
- Restoring a persisted store's saved state after an asynchronous read at startup, before which the store holds only its initial values.
- Over-the-air update
- Delivering a new JavaScript bundle to installed apps without a store release. It can change JavaScript and assets, never native code.
Follow one tap through the app. The touch lands on the UI thread, where either a native gesture recognizer claims it or React Native's responder system forwards it to the JavaScript thread. Your handler runs there, updates state, and React renders. Fabric turns the result into a tree of views to display, Yoga lays it out, and the changes are applied to native views on the UI thread in the next frame. If the handler calls a native capability — secure storage, the camera, a module you wrote — it goes through JSI to a Turbo Module, and a slow call is either awaited as a promise or streamed back as events. The same path explains where the hub's sections attach: - **Lists, styling and primitives** decide how much the render and layout steps have to do. - **Animations and gestures** either stay on the JavaScript thread or move to the UI thread through the native driver or Reanimated worklets. - **Navigation, state and networking** decide what re-renders and what survives the app being backgrounded or killed. - **Push, deep links and background work** enter from the OS side, often before any screen exists. The build pipeline is the other axis. Metro bundles the JavaScript, resolving `.ios` and `.android` files per platform; release builds precompile it with Hermes and embed it in a native app that Xcode or Gradle compiles, signs and uploads. Debugging tools, Fast Refresh and Jest all run in a different world from that shipped binary, which is why testing, profiling and release each have their own section. A single component often touches three layers at once: ```tsx const styles = StyleSheet.create({ row: { flexDirection: 'row', padding: 12 } }); const Row = memo(({ item }: { item: Item }) => ( <View style={styles.row}><Text>{item.title}</Text></View> )); function Feed({ items }: { items: Item[] }) { const opacity = useAnimatedValue(0); useEffect(() => { Animated.timing(opacity, { toValue: 1, duration: 200, useNativeDriver: true }).start(); }, [opacity]); return ( <Animated.View style={{ flex: 1, opacity }}> <FlatList data={items} keyExtractor={(i) => i.id} renderItem={({ item }) => <Row item={item} />} /> </Animated.View> ); } ``` Yoga lays out the row horizontally only because the style asks for it; the list mounts only a window of memoized rows on the JavaScript thread; the fade, once started, runs on the UI thread and keeps going even if JavaScript is busy.
- Core UI Primitives →
The built-in views every screen is made of, and the first place web habits break: text placement, images, inputs, scroll containers.
- Styles & Flexbox →
How style objects and Yoga's flexbox differ from CSS, and how units, themes and fonts work on devices.
- Virtualized Lists →
Virtualized lists are how real screens show data, and the classic entry point to performance questions.
- Screen Navigation →
Screen structure, params and auth flows shape the whole app and are expensive to change later.
- Runtime Layers →
Threads, JSI, Fabric and Hermes: the model that performance, animation and native module answers all rely on.
- Speed & Memory Tuning →
Diagnosing jank, re-renders, startup and leaks once you can say which thread owns which work.
Treating React Native as a web page: styles do not cascade, raw text needs a
Textparent, and flexbox starts in a column.Rendering a long or unbounded list in a
ScrollView, which mounts every row at once; see Virtualized Lists.Blaming "React Native" for jank without saying whether the JavaScript thread or the UI thread dropped the frame.
Profiling a debug build and reporting its numbers; development-mode JavaScript and missing bytecode make it far slower than what users run.
Calling a value from
.envor a public build variable a secret: it is compiled into a binary anyone can download and unpack.Handling a deep link or notification tap only while the app is running, so the same link from a killed app opens nothing.
Describing one platform's behaviour as React Native's: permissions, back handling, link verification and signing all differ between iOS and Android.
Explaining the New Architecture as "the bridge, but faster" instead of naming what JSI removed: serialized, always-asynchronous messages.
Promising an over-the-air update can fix anything; a change to native code or native dependencies still needs a new store build.
This guide assumes a current React Native release on the New Architecture with Hermes, the line the questions below mention as 0.87. Interviewers still ask about the path there, because many production apps were built on older versions: - **0.70** made Hermes the default engine. - **0.74** removed Flipper's integration from new projects. - **0.76** enabled the New Architecture by default and shipped React Native DevTools as the standard debugger. - **0.79** removed Remote JS Debugging, whose code executed inside a desktop browser instead of on the phone. - **0.82** runs only on the New Architecture; opting back into the legacy bridge is no longer possible. Libraries moved with it: Reanimated 4 requires the New Architecture, and React Navigation 7 is the version this hub's navigation questions use. When an answer depends on the bridge, the old renderer or a debugging tool that no longer ships, say which era you are describing — interviewers maintaining older apps will ask, and naming the version is part of a correct answer.
React Native is rarely used alone. **Expo** is the framework its docs recommend: file-based routing through Expo Router, a large set of native module packages, cloud builds and over-the-air updates. Around it, most apps pick React Navigation or Expo Router for screens, Reanimated and Gesture Handler for motion, FlashList where FlatList struggles, TanStack Query for server state, and a small store such as Zustand or Redux Toolkit for client state. Interviewers also expect you to place it among alternatives. **Fully native** apps in Swift and Kotlin get every platform API first and have no cross-language boundary, at the price of two codebases. **Flutter** also shares one codebase but draws its own widgets with its own rendering engine instead of using platform views, so it looks the same on both platforms unless you adapt it. **Kotlin Multiplatform** shares business logic while leaving the UI native or moving it to Compose Multiplatform. **WebView hybrids** such as Ionic with Capacitor render HTML inside a native shell, which reuses web skills and costs native feel. A defensible choice names the team's existing skills, how much platform-specific UI the product needs, and how much native code it will have to write anyway.
explore
- Runtime Layers20 questions
- Thread Model3 questions
- JSI & the Legacy Bridge4 questions
- Fabric Renderer4 questions
- Hermes Engine4 questions
- Interop & Migration5 questions
- Turbo Modules & Codegen30 questions
- Typed Specs & Generation5 questions
- Swift & Objective-C++ Glue5 questions
- Kotlin Spec Classes5 questions
- Fabric View Components6 questions
- Promises, Callbacks & Events4 questions
- Autolinking & Library Packaging5 questions
- Project Setup23 questions
- Framework or Bare Start5 questions
- Xcode & Android Toolchains5 questions
- Framework Upgrades5 questions
- TypeScript Configuration4 questions
- Build Variants & Env Config4 questions
- Debugging & Dev Loop20 questions
- Fast Refresh4 questions
- Developer Menu & LogBox4 questions
- DevTools Inspector4 questions
- Source Maps & Symbolication4 questions
- Physical Device Runs4 questions
- Core UI Primitives39 questions
- View & Text Rules6 questions
- TextInput Control6 questions
- Images & Backgrounds6 questions
- Pressable & Buttons4 questions
- Modals, Switches & Indicators6 questions
- Keyboard & Safe Areas5 questions
- ScrollView & Refresh6 questions
- Virtualized Lists25 questions
- FlatList Props & Keys5 questions
- Grouped Sections5 questions
- Windowing & Render Tuning5 questions
- Infinite Scroll & Refresh5 questions
- FlashList Recycling5 questions
- Styles & Flexbox26 questions
- StyleSheet Objects5 questions
- Yoga Engine Defaults6 questions
- Units & Pixel Density5 questions
- Dark Mode & Theming5 questions
- Custom Fonts & Typography5 questions
- Platform-Specific Code19 questions
- OS Detection & Select4 questions
- Per-OS File Extensions3 questions
- Android-Only APIs6 questions
- iOS-Only APIs6 questions
- Assistive Tech Support19 questions
- Labels, Roles & States5 questions
- Reader Detection & Announcements4 questions
- Custom Actions & Grouping5 questions
- Dynamic Type Sizes5 questions
- Gestures & Motion28 questions
- Responder System6 questions
- UI-Thread Recognizers6 questions
- Animated API6 questions
- Reanimated Worklets5 questions
- Scroll & Swipe Effects5 questions
- Screen Navigation31 questions
- Deep Link Handling14 questions
- Custom URL Schemes5 questions
- Domain-Verified URLs4 questions
- Cold & Warm Start Routing5 questions
- Push Notification Handling21 questions
- Device Tokens & Providers4 questions
- Consent Prompt Timing6 questions
- Delivery by App State5 questions
- Channels & Local Scheduling6 questions
- Networking & Connectivity19 questions
- Fetch & HTTP Clients5 questions
- WebSocket Client4 questions
- Online Status Detection5 questions
- Server-State Caching5 questions
- App State & Data19 questions
- Client Store Choices4 questions
- Persisted Stores4 questions
- Foreground & Background3 questions
- Background Execution4 questions
- Offline-First Queues4 questions
- Mobile App Hardening26 questions
- Credential Storage5 questions
- OAuth Sign-In Flows4 questions
- Transport Rules & Pinning5 questions
- Bundle Exposure & Secrets4 questions
- Runtime Permissions4 questions
- Device Integrity Checks4 questions
- Speed & Memory Tuning26 questions
- Frame Budget & Jank4 questions
- Re-Render Hot Spots4 questions
- Startup Time5 questions
- Trace & Profile Capture5 questions
- Leaks & Heap Growth4 questions
- Faster Compiles4 questions
- Unit Test Setup13 questions
- Runner Preset & Transforms5 questions
- Mocking Platform Modules4 questions
- Coverage Layer Choice4 questions
- Store Release19 questions
- Android Signing & Bundles5 questions
- iOS Archives & Provisioning5 questions
- Review Rules & Rollouts4 questions
- Hosted CI Builds5 questions
questions
437 · 19 sectionsIn React Native, what is the Fabric renderer, and what does it enable that the legacy renderer could not?
basics
~20 sFabric is React Native's New Architecture renderer: a shared C++ core that turns React's tree into native views through an immutable shadow tree. It enables synchronous layout reads, concurrent features such as Transitions and Suspense, and flattening on both platforms.
What is Hermes in React Native, and why does it make a release build start faster than an engine that parses JavaScript source at launch?
basics
~20 sHermes is React Native's default JavaScript engine. In release builds its compiler, hermesc, turns the Metro bundle into bytecode on the build machine, so at launch the device runs ready bytecode instead of parsing and compiling JavaScript source.
In React Native, what work runs on the JavaScript thread and what runs on the UI (main) thread?
basics
~20 sThe JavaScript thread runs your bundle: React rendering, state updates, event handlers, timers and fetch callbacks. The UI (main) thread is the only one that creates and mutates native views, and it handles raw touches, native scrolling and native animations.
In React Native, what did JSI change compared with the legacy bridge for calls between JavaScript and native code?
basics
~20 sThe legacy bridge sent serialized, batched messages asynchronously, so native calls normally answered through callbacks or promises. JSI lets JavaScript call C++ host functions synchronously and hold references to C++ host objects, with no serialization step.
In React Native 0.87, can a team still switch the New Architecture off, and what happens if gradle.properties sets newArchEnabled=false?
basics
~20 sNo. The New Architecture is the only architecture since React Native 0.82: newArchEnabled=false on Android and RCT_NEW_ARCH_ENABLED=0 on iOS are ignored with a warning, and the app still runs on it, with old libraries loaded through interop layers.
In React Native, what does autolinking do when you install a library that contains native code, and what must you still do yourself?
basics
~20 sAutolinking finds the app's dependencies that ship native code and adds them to the iOS and Android builds automatically. You still run pod install on iOS, rebuild the native app, and do any library-specific setup such as permissions.
In React Native, what is the difference between a Turbo Module and a Fabric native component, and which does a signature-pad view need?
basics
~20 sA Turbo Module is a set of native functions with no UI, called from JavaScript. A Fabric native component is a platform view in the React tree, configured by props, reporting through events, driven by commands. A signature pad draws on screen, so it needs a component.
In React Native 0.87, how do you implement an Android Turbo Module in Kotlin against its Codegen-generated abstract spec class?
basics
~20 sSubclass the generated abstract NativeXxxSpec, passing the ReactApplicationContext to its constructor, and override every abstract method it declares, with a Promise parameter for async results and a plain return for sync ones. Then return an instance from a BaseReactPackage.
When designing a React Native Turbo Module spec, when should a method return a Promise, take a callback, or be an EventEmitter instead?
basics
~20 sReturn a Promise for one asynchronous result that can fail, declare an EventEmitter for many values over time, and treat a callback as a one-shot legacy alternative; a plain return value suits only cheap, immediate data.
In React Native 0.87, what must an iOS Turbo Module's Objective-C++ class implement to satisfy its Codegen-generated spec?
basics
~20 sThe class adopts the generated NativeXxxSpec protocol, implements every selector it declares, returns the generated NativeXxxSpecJSI from getTurboModule:, returns the JavaScript name from +moduleName, and is registered in codegenConfig.ios so React Native can map that name to the class.
What do the React Native docs recommend for starting a new app today, and why do they favour a framework over a bare project?
basics
~20 sThe React Native docs recommend starting new apps with a framework, and Expo is the one they name, because it already solves routing, native dependencies, native builds and upgrades; a bare project means assembling and maintaining those pieces yourself.
In a bare React Native iOS project, what does pod install do, and why must you open the .xcworkspace afterwards?
basics
~20 spod install reads ios/Podfile, resolves React Native's pods and every native library's pods, writes Podfile.lock and generates a Pods project plus an .xcworkspace that joins it to the app project, so Xcode must build the workspace.
In a React Native app, why is process.env.API_URL undefined at runtime, and how do per-environment values actually reach the JavaScript?
basics
~20 sReact Native's JavaScript runs on the device with no Node process, so process.env holds only NODE_ENV. Per-environment values must be inlined into the bundle at build time or read from native build config, and both are readable in the shipped app.
In a React Native TypeScript app, what turns .tsx into JavaScript for Metro, and why can the app run with type errors?
basics
~10 sMetro compiles .ts and .tsx with Babel, where @react-native/babel-preset's TypeScript plugin deletes type annotations without checking them. Type errors are only reported by tsc, which @react-native/typescript-config runs as a noEmit checker.
How do you upgrade a bare React Native app to a new version, and what does the Upgrade Helper give you?
basics
~20 sBump react-native and react to the versions the Upgrade Helper's package.json shows, then hand-apply its diff of the project template to the iOS, Android and JavaScript config files, update native libraries, reinstall pods and rebuild both platforms.
Why does a React Native debug build on a USB-connected Android phone need adb reverse tcp:8081 tcp:8081 to reach Metro?
basics
~20 sOn a physical Android device the debug app asks for the Metro dev server at localhost:8081 on the phone itself. adb reverse forwards the phone's port 8081 over USB to port 8081 on your computer, where Metro listens.
In a React Native 0.87 app, how do you open React Native DevTools, and what do its main panels let you do?
basics
~20 sPress j in the dev server terminal or choose Open DevTools in the Dev Menu. React Native DevTools, a Chrome DevTools-based debugger attached to Hermes on the device, gives you Console, Sources with breakpoints, Network and React Components panels.
In React Native, what does Fast Refresh keep when you save an edit, and when does it fall back to a full reload instead?
basics
~20 sFast Refresh swaps edited modules into the running app and keeps function component and Hook state. If an edited module is reached through an import path from outside the React tree, it falls back to a full reload, which re-runs the bundle and loses all state.
In a React Native release build, why does a JavaScript crash stack show frames like p@1:132161 instead of your file and line?
basics
~20 sA release build runs one Metro bundle compiled to Hermes bytecode, so frames give a function name and a bytecode offset, not your files. Symbolication maps them back with the source map from that exact build, for example using metro-symbolicate.
In React Native, why does an Image with a require() source appear without a size while a remote uri Image renders blank?
basics
~20 sA require() source is a bundled asset whose width and height the bundler records, so Image sizes itself on mount. A remote uri has no known size, and React Native deliberately never sizes it after download, so without dimensions it lays out at zero.
In React Native, what do Image's resizeMode values do, which is the default, and which would you use for listing photos versus a floor plan?
basics
~20 sresizeMode sets how an Image fits a box of a different shape: cover (the default) fills and crops, contain shows everything with bands, stretch distorts, repeat tiles, center never enlarges. Listing photos suit cover; a floor plan needs contain.
In React Native 0.87, why is core SafeAreaView deprecated, and how do you keep a chat screen clear of the notch using react-native-safe-area-context?
basics
~10 sCore SafeAreaView is iOS-only, applies padding only and does not work with Android edge-to-edge, so 0.81 deprecated it. Use react-native-safe-area-context: SafeAreaProvider at the root, its SafeAreaView with edges, or useSafeAreaInsets for explicit padding.
Why does a React Native Switch snap back after the user toggles it, and how do value and onValueChange fix it?
basics
~20 sReact Native's Switch is controlled: after the native toggle moves, the component resets it to the value prop. If onValueChange does not update the state behind value, the switch snaps back, so store the new boolean it receives.
In React Native, why do teams build custom buttons with Pressable instead of the core Button or the Touchable* components?
basics
~20 sCore Button renders a fixed platform look from a string title and has no style prop, and each Touchable bakes in one feedback effect. Pressable exposes the pressed state and the full press lifecycle, so any design can be built on it.
What is FlashList in React Native, and how does its cell recycling differ from FlatList's virtualization?
basics
~20 sFlashList (@shopify/flash-list) is a FlatList-compatible list that recycles: a cell scrolled off screen stays mounted and is re-rendered with a different item. FlatList instead unmounts cells outside its render window and mounts new ones as you scroll.
In a React Native FlatList, what does keyExtractor do, and which key does the list use when you omit it?
basics
~20 skeyExtractor returns a unique, stable string for each FlatList item; the list uses it as the React key and to cache that cell's measurements. Without it, FlatList tries item.key, then item.id, then falls back to the index and warns about missing keys.
How do you add pull-to-refresh to a React Native FlatList, and what do its refreshing and onRefresh props do?
basics
~20 sPassing onRefresh makes a React Native FlatList add a standard RefreshControl; refreshing is the controlled boolean that shows the indicator. Set refreshing true when the reload starts and false when it ends, and replace the first page rather than appending.
In a React Native SectionList, what shape must the sections prop have, and what do renderItem and renderSectionHeader receive?
basics
~20 sA React Native SectionList takes sections: an array of objects, each with a required data array plus any fields you add, such as title. renderItem receives item, index within its section, section and separators; renderSectionHeader and renderSectionFooter receive the section.
In a React Native FlatList, why can rows ignore a state change such as a selected contact, and what does extraData fix?
basics
~20 sFlatList is a PureComponent, so it skips re-rendering when its props are shallowly equal. If renderItem depends on state outside data, such as a selected id, pass that state as extraData so the list re-renders and rows see the change.
In React Native, what unit is a style value such as width: 120, and how does PixelRatio map it to physical pixels?
basics
~20 sStyle lengths are unitless density-independent points (dp on Android). PixelRatio.get() returns the device's scale, so width: 120 covers 120 x scale physical pixels: 360 on a 3x screen. getPixelSizeForLayoutSize does that conversion, rounded to an integer.
In a bare React Native project, what must you do so a bundled .ttf file can be used through the Text fontFamily style?
basics
~10 sCopy the font into each native project: android/app/src/main/assets/fonts on Android, and the iOS app target plus a UIAppFonts entry in Info.plist. Then rebuild the native app and reference it by name in fontFamily.
In React Native, how do you apply a conditional style such as a disabled coupon card, and which style wins when entries conflict?
basics
~20 sReact Native's style prop accepts an array, so a disabled card uses [styles.card, disabled && styles.cardDisabled]. Falsy entries are skipped, and for each property the last entry that sets it wins; there are no selectors or cascade.
What does StyleSheet.create do in React Native 0.87, and how does it differ from passing an inline style object?
basics
~20 sIn React Native 0.87, StyleSheet.create returns the object it is given, freezing each style in development; its practical benefit is TypeScript checking. An inline style object works the same but is recreated on every render.
In React Native, how does useColorScheme report the system light or dark setting, and why prefer it over Appearance.getColorScheme()?
basics
~10 suseColorScheme returns 'light' or 'dark' (null only without the native Appearance module) and re-renders the component whenever the scheme changes. Appearance.getColorScheme() returns the same value once, so a stored result goes stale.
In React Native, how does Metro pick between DatePicker.ios.tsx, DatePicker.android.tsx and DatePicker.native.tsx for an import of './DatePicker'?
basics
~10 sImport without the suffix. Bundling for a platform, Metro tries that platform's suffix first (.ios or .android), then .native, then the plain file, so each platform's bundle contains only its matching implementation.
In React Native, what do Platform.OS and Platform.select return, and how does Platform.select choose between ios, android, native and default keys?
basics
~20 sPlatform.OS is the running platform's name, 'ios' or 'android'. Platform.select(spec) returns the value under that platform's key, otherwise under native, otherwise under default, otherwise undefined; the value can be anything, from a number to a style object.
In React Native, how does BackHandler decide whether an Android back press is handled by your code or exits the app?
basics
~20 sBackHandler calls hardwareBackPress listeners newest-first; the first one that returns true consumes the press and older listeners never run. If none returns true, React Native falls back to Android's default back behaviour, which leaves the app.
In React Native, what does the Android-only elevation style do, and why does a card styled only with iOS shadow props look flat on Android?
basics
~20 selevation sets Android's native view elevation, which draws a system shadow and lifts the view above non-elevated siblings. shadowOffset, shadowOpacity and shadowRadius are iOS-only, so on Android only elevation (tinted by shadowColor on API 28+) or boxShadow produces a shadow.
In React Native, why does a view with only shadowColor set show no shadow on iOS, and when would you use boxShadow instead of the shadow props?
basics
~20 sReact Native's shadow props map to the iOS layer shadow, and shadowOpacity defaults to 0, so shadowColor alone draws nothing. boxShadow is the web-style alternative that also renders on Android, supports spread, inset and multiple shadows, and needs the New Architecture.
In React Native, what does a screen reader announce for an icon-only Pressable without accessibilityLabel, and how do accessibilityLabel and accessibilityHint fix it?
basics
~20 sReact Native builds a default label from a pressable's Text children, so an icon-only Pressable has no meaningful name and no role. Set accessibilityLabel (or aria-label) to its purpose and role='button'; use accessibilityHint only to explain a non-obvious result.
In React Native, how does Text react to the system font size setting, and what do allowFontScaling and maxFontSizeMultiplier change?
basics
~10 sText scales with the user's system font size by default because allowFontScaling is true; maxFontSizeMultiplier caps how far one Text, and the Text nested in it, may grow, while allowFontScaling={false} switches scaling off entirely.
In React Native, how do announceForAccessibility and accessibilityLiveRegion differ for telling screen-reader users a money transfer completed?
basics
~20 sAccessibilityInfo.announceForAccessibility speaks a string on both iOS and Android at the moment you call it; accessibilityLiveRegion makes TalkBack read a view when its content changes but does nothing on iOS, so VoiceOver users still need the imperative call.
In React Native, what is the difference between accessibilityState and accessibilityValue, and how does a disabled Pressable get announced as disabled?
basics
~20 saccessibilityState carries flags — disabled, selected, checked (true, false or 'mixed'), busy, expanded — while accessibilityValue carries a range (min, max, now) or a text value. Pressable copies its disabled prop into accessibilityState.disabled, so it is announced as disabled.
In React Native, how do you make a swipe-to-archive email row usable for VoiceOver and TalkBack users who cannot perform the swipe?
basics
~10 sDeclare the swipe operations as custom actions with accessibilityActions, such as archive with a label, and run them in onAccessibilityAction by switching on event.nativeEvent.actionName; screen-reader users then pick Archive from the row's action list.
In React Native, how do you animate a like-button heart pop with Animated.spring, and what does useNativeDriver: true change?
basics
~10 sKeep an Animated.Value from useAnimatedValue, start Animated.spring on it, and bind it to an Animated.View's transform scale. useNativeDriver: true hands the animation to native before it starts, so the UI thread computes every frame.
In React Native 0.87, which style properties can Animated's native driver animate, and what happens if you native-drive a heart's width?
basics
~20 sBy default the native driver animates only non-layout styles: transform, opacity, colours, border radii, shadow opacity and radius, elevation, zIndex and filter. Native-driving width logs an error that the style is not supported; animate transform: scale instead.
In React Native Gesture Handler 3, when do you use useSimultaneousGestures, useExclusiveGestures and useCompetingGestures to combine gestures on one view?
basics
~20 suseSimultaneousGestures lets all gestures be active together, useExclusiveGestures gives them a priority order where each waits for the ones before it to fail, and useCompetingGestures lets the first to activate cancel the rest. All three combine gestures on one detector.
In React Native, why does a Gesture Handler pan keep tracking the finger while the JavaScript thread is busy, when a PanResponder drag stalls?
basics
~20 sGesture Handler recognises gestures natively on the UI thread, and with Reanimated installed its hook callbacks run as worklets on the UI thread too. PanResponder decides and reacts in JavaScript, so a busy JS thread delays every move.
In React Native, how do Linking.getInitialURL() and Linking.addEventListener('url', …) differ, and why does an app need both?
basics
~20 sLinking.getInitialURL() resolves to the URL that launched a killed app, or null; the 'url' event fires when a link arrives while the app is already running. Handling only one loses either cold-start or warm-start links.
In React Native, how does Linking.openURL open the mail app, the dialer or a browser from a password-reset screen, and when does it fail?
basics
~20 sReact Native's Linking.openURL hands a URL to the operating system, which opens the app registered for its scheme: mailto: for mail, tel: for the dialer, https: for the browser. Its promise rejects when nothing can open the URL.
In a bare React Native app, how do you register a custom URL scheme like resetapp:// on iOS and Android?
basics
~20 sRegister the scheme natively: on iOS add it under CFBundleURLTypes / CFBundleURLSchemes in Info.plist; on Android add an intent-filter with the VIEW action, DEFAULT and BROWSABLE categories and a data scheme to MainActivity. Then rebuild the app.
In a React Native app, what must the website and the native projects configure so iOS Universal Links and Android App Links verify?
basics
~10 sThe domain hosts /.well-known/apple-app-site-association (Team ID plus bundle ID, paths) and /.well-known/assetlinks.json (package name, SHA-256 signing fingerprints) over HTTPS; the app declares applinks:domain in Associated Domains and an https intent filter with autoVerify.
In an Expo project, what does the app config's scheme field do, and why does changing it require a new build rather than an update?
basics
~20 sExpo's scheme field declares the app's custom URL scheme; prebuild writes it into Info.plist's CFBundleURLTypes and an Android VIEW intent filter. That is native configuration, so it needs a new build — an over-the-air update cannot add it.
With expo-notifications, how do you schedule a daily local medication reminder in a React Native app, and which trigger types exist?
basics
~10 sCall Notifications.scheduleNotificationAsync with content and a trigger such as { type: SchedulableTriggerInputTypes.DAILY, hour, minute }; it resolves an identifier for cancelling. Other triggers: DATE, TIME_INTERVAL, WEEKLY, MONTHLY, YEARLY and iOS-only CALENDAR.
With expo-notifications, why does a push not appear while the React Native app is open, and what does setNotificationHandler change?
basics
~10 sIn the foreground the app, not the operating system, decides how a notification is presented, and with no handler expo-notifications shows nothing. setNotificationHandler returns a behavior per notification: banner, list, sound and badge.
In a React Native app, how does asking for push notification permission differ between iOS and Android 13 or later?
basics
~20 siOS requires every app to request notification authorization through a one-time system alert. Android showed notifications by default until Android 13 (API 33) added the POST_NOTIFICATIONS runtime permission, which must be declared in the manifest and requested.
In a React Native app, what is a push device token, and which provider issues it on iOS and on Android?
basics
~20 sA device token is an opaque address the push provider issues for one app installation. On iOS it comes from APNs, on Android from FCM; the app sends it to its backend, which uses it to target that install.
In a React Native app on Android, why does changing an existing notification channel's importance or sound have no effect?
basics
~20 sOnce an Android channel exists, its behavior (importance, sound, vibration) is under the user's control; recreating it with the same id updates details such as name and description and can at most lower the importance. To change behavior, use a new channel id and delete the old one.
In a React Native app on the Android emulator, why does fetch('http://localhost:3000/api') fail, and which address reaches your development machine?
basics
~20 sOn the Android emulator, localhost is the emulator itself, not your computer. The stock emulator reaches the host's loopback through 10.0.2.2; the iOS Simulator shares the Mac's network, so localhost works there, and a physical phone needs the computer's LAN IP.
In React Native, how do you read the network state once and subscribe to its changes with NetInfo's fetch, addEventListener and useNetInfo?
basics
~20 sNetInfo.fetch() resolves to the current NetInfoState (the cached latest one if available; refresh() forces a new query). NetInfo.addEventListener(cb) calls back now and on every change and returns an unsubscribe function. useNetInfo() wraps that subscription in a hook that starts as unknown.
In a React Native screen, how do you open a WebSocket, handle its onopen, onmessage and onclose events, and close it cleanly?
basics
~20 sCreate the global WebSocket in a useEffect, send only after onopen, parse event.data in onmessage and call ws.close() in the cleanup. React Native's send() throws while still connecting, and a failed connection fires error, then close with code 1006.
Why does a React Native app's fetch call never fail with a CORS error, when the same request from a web page does?
basics
~20 sCORS is a rule browsers enforce on pages from another origin. A React Native app's fetch uses the native HTTP stack, which has no page origin and no CORS check, so CORS headers neither block nor protect anything; the API must authenticate callers.
With React Native's NetInfo, what is the difference between isConnected and isInternetReachable, and which should drive an offline banner?
basics
~20 sisConnected says the device has an active network link; isInternetReachable says that link actually reaches the internet, and is null while unknown. Drive an offline banner from isInternetReachable === false, never from null, and still treat failed API calls as the final word.
In React Native, what do the AppState values active, background and inactive mean, and how do you subscribe to changes?
basics
~10 sReact Native's AppState reports active (foreground), background, or, on iOS only, inactive during transitions. Read AppState.currentState, subscribe with AppState.addEventListener('change', handler), and call remove() on the returned subscription.
In an offline-capable React Native app, why must pending writes go into a persisted outbox rather than memory, and when is it replayed?
basics
~20 sPending writes held in memory vanish when the OS kills the app or it crashes. A persisted outbox keeps each write on disk until the server confirms it, replaying on reconnect, at launch and on return to the foreground.
With a React Native store persisted to AsyncStorage, why does a workout app first flash an empty log, and how do you gate on hydration?
basics
~20 sAsyncStorage reads are asynchronous, so the store starts with its initial state and the saved log arrives a moment later. Gate on hydration: redux-persist's PersistGate renders its loading prop until rehydration completes, and Zustand exposes persist.hasHydrated and onFinishHydration.
In a React Native sneaker store, why can a cart kept in one React Context make low-end Android phones stutter on every quantity change?
basics
~20 sEvery component reading the cart Context re-renders when its value changes, including those on mounted but hidden screens. That work runs on React Native's single JavaScript thread, so a slow phone misses frames and taps lag.
With expo-task-manager in a React Native app, why must TaskManager.defineTask be called at module top level rather than inside a component?
basics
~20 sWhen the OS wakes an Expo app for a task, React Native evaluates the JavaScript bundle but mounts no views, so a defineTask inside a component never runs. expo-task-manager then finds no task, logs a warning and unregisters it.
In a React Native app, why is an API key read from a .env file or an EXPO_PUBLIC_ variable not actually secret?
basics
~20 sThe value is copied into the build at build time, and that build ships inside every APK and IPA, so anyone who downloads the app can extract it. Real secrets must stay on a server the app calls.
In a React Native app, where should a refresh token be stored, and why is AsyncStorage the wrong place for it?
basics
~20 sA refresh token belongs in platform secure storage: the iOS Keychain, or a value encrypted with an Android Keystore key, reached through expo-secure-store or react-native-keychain. AsyncStorage is an unencrypted store that anyone reading the app's files can open.
In an Expo app, which expo-web-browser function runs an OAuth sign-in in the system browser, and what does it use on iOS and Android?
basics
~20 sWebBrowser.openAuthSessionAsync(authUrl, redirectUrl) from expo-web-browser. On iOS it runs ASWebAuthenticationSession; on Android it opens a Custom Tab and waits for the redirect deep link. It resolves with { type: 'success', url } or a cancel or dismiss result.
In a React Native Android app, how do you request the camera permission with PermissionsAndroid, and what can the request resolve to?
basics
~10 sCall PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.CAMERA) after declaring CAMERA in the manifest; it resolves to 'granted', 'denied' or 'never_ask_again', while check() only reports whether the permission is already held.
With expo-auth-session, how do useAuthRequest, promptAsync and exchangeCodeAsync fit together in an authorization-code sign-in with PKCE?
basics
~10 suseAuthRequest builds the request (state plus a PKCE verifier and S256 challenge) and returns [request, response, promptAsync]. promptAsync opens the system browser; on success you pass response.params.code and request.codeVerifier to exchangeCodeAsync to get tokens.
In React Native, how do you clean up an AppState listener and a setInterval inside useEffect, and what leaks if you forget?
basics
~20 sKeep the subscription that AppState.addEventListener returns and call its remove() in the effect's cleanup, and clearInterval the saved interval id there too. Otherwise the handlers keep running and keep the unmounted screen's closures, state and data in memory.
Why can console.log calls slow a React Native release build, and how do you strip them with babel-plugin-transform-remove-console?
basics
~20 sReact Native keeps console calls in release bundles, formatting every argument on the JS thread and passing it to the native logger. Add babel-plugin-transform-remove-console under env.production in babel.config.js to strip every console call from release builds.
In React Native's Perf Monitor overlay, what do the separate JS and UI frame rates tell you, and how do you tell which thread janked?
basics
~20 sThe UI rate measures the native main thread that draws views and runs scrolling; the JS rate measures the thread running React and your handlers. Whichever falls, and which symptoms appear, tells you where to look.
Why do performance numbers from a React Native debug build mislead you, and which build should you profile instead?
basics
~20 sA debug build runs development-mode JavaScript served by Metro, with dev-only checks and warnings and no Hermes bytecode precompilation, so the JS thread does far more work than in production. Profile a release or profileable release-like build on a real device.
In React Native, why do eager screen imports and module side effects lengthen cold start, and how do lazy-loaded screens help?
basics
~20 sEvery module imported from the entry file is evaluated before the first screen renders, including any top-level work it does. Loading rarely used screens lazily, with getComponent or React.lazy, keeps that work off the startup path.
In a React Native 0.87 app, what does @react-native/jest-preset configure, and why can't plain Jest run React Native code?
basics
~10 s@react-native/jest-preset makes Jest able to load React Native code: it compiles JS and TS through babel-jest, transforms React Native's own untranspiled packages, stubs image requires, uses a Node-based environment and mocks core native modules.
In a React Native app's Jest suite, why does a calendar's untranspiled date library fail on import statements, and how do you fix it?
basics
~10 sJest skips transforming files that match transformIgnorePatterns, and the React Native preset only allowlists react-native and @react-native packages, so an ESM date library reaches Node untranspiled. Add the package to the same negative-lookahead regex.
What can a React Native component test under Jest and React Native Testing Library not see that a device test can?
basics
~20 sA Jest and React Native Testing Library test runs only JavaScript in Node: native modules are mocks, no layout is computed, gestures are simulated by calling handlers, and the engine and build differ from the shipped app.
In React Native Jest tests, why does a screen using a custom location TurboModule fail on import, and how do you mock it?
basics
~20 sUnder Jest there is no native binary, so TurboModuleRegistry.getEnforcing cannot find the location module and throws when the spec file is imported. Mock that spec module (or your wrapper around it) with jest.mock and a factory of jest.fn methods.
In React Native Jest tests, what is Platform.OS by default, and how do you test a component's Android branch?
basics
~20 sPlatform.OS is 'ios' in tests because the React Native preset's haste defaultPlatform is 'ios', so Platform.ios.js and .ios files load. Test Android branches with a second Jest project whose defaultPlatform is 'android', or by injecting the value.
In a React Native Android release, what is the difference between an AAB and an APK, and which one does Google Play expect?
basics
~20 sAn APK is the package a device installs; an AAB (Android App Bundle) is a publishing format Google Play turns into per-device APKs. React Native's release command runs bundleRelease to build the AAB Play requires for new apps.
What changes when a React Native iOS app is built with Xcode's Release configuration instead of Debug?
basics
~20 sA Release build embeds the JavaScript as main.jsbundle inside the app, loads it from there instead of from Metro, compiles the JS in production mode and removes the Dev Menu. Archives for the App Store always use Release.
How do you sign a React Native Android release with your own upload keystore instead of the template's debug keystore?
basics
~20 sGenerate an upload keystore with keytool, put its path, alias and passwords in MYAPP_UPLOAD_* Gradle properties, add a signingConfigs.release block that reads them, and point buildTypes.release at it; the fresh template signs release with the debug keystore.
In a React Native CI pipeline, how do you get the Android upload keystore and iOS signing assets into the build without committing them?
basics
~10 sStore the keystore, certificate and profile as base64 CI secrets, decode them into temporary files at build time, pass the passwords as Gradle properties or environment variables, and delete everything when the job ends.
For a React Native iOS release, what do the distribution certificate and the App Store provisioning profile each do when you archive and upload?
basics
~20 sThe distribution certificate, with its private key in your keychain, proves the build comes from your team. The App Store provisioning profile ties that certificate to one bundle identifier and its entitlements. Xcode signs the archive with both before upload.