skip to content

React Native

1 roadmap437 questionsupdated

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 pageshow

guide

overview

~2 min

React 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.

  1. 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.

  2. Styles & Flexbox →

    How style objects and Yoga's flexbox differ from CSS, and how units, themes and fonts work on devices.

  3. Virtualized Lists →

    Virtualized lists are how real screens show data, and the classic entry point to performance questions.

  4. Screen Navigation →

    Screen structure, params and auth flows shape the whole app and are expensive to change later.

  5. Runtime Layers →

    Threads, JSI, Fabric and Hermes: the model that performance, animation and native module answers all rely on.

  6. 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 Text parent, 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 .env or 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

report an issue with this guide →

questions

437 · 19 sections

In React Native, what is the Fabric renderer, and what does it enable that the legacy renderer could not?

level: juniorimportance: must knowfreq 60%
basics
~20 s

Fabric 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.

open as a page

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?

level: juniorimportance: must knowfreq 72%
basics
~20 s

Hermes 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.

open as a page

In React Native, what work runs on the JavaScript thread and what runs on the UI (main) thread?

level: juniorimportance: must knowfreq 75%
basics
~20 s

The 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.

open as a page

In React Native, what did JSI change compared with the legacy bridge for calls between JavaScript and native code?

level: middleimportance: must knowfreq 75%
basics
~20 s

The 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.

open as a page

In React Native 0.87, can a team still switch the New Architecture off, and what happens if gradle.properties sets newArchEnabled=false?

level: middleimportance: must knowfreq 62%
basics
~20 s

No. 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.

open as a page

In React Native, what does autolinking do when you install a library that contains native code, and what must you still do yourself?

level: juniorimportance: must knowfreq 50%
basics
~20 s

Autolinking 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.

open as a page

In React Native, what is the difference between a Turbo Module and a Fabric native component, and which does a signature-pad view need?

level: juniorimportance: must knowfreq 45%
basics
~20 s

A 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.

open as a page

In React Native 0.87, how do you implement an Android Turbo Module in Kotlin against its Codegen-generated abstract spec class?

level: middleimportance: must knowfreq 45%
basics
~20 s

Subclass 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.

open as a page

When designing a React Native Turbo Module spec, when should a method return a Promise, take a callback, or be an EventEmitter instead?

level: middleimportance: must knowfreq 50%
basics
~20 s

Return 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.

open as a page

In React Native 0.87, what must an iOS Turbo Module's Objective-C++ class implement to satisfy its Codegen-generated spec?

level: middleimportance: must knowfreq 45%
basics
~20 s

The 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.

open as a page

In a bare React Native iOS project, what does pod install do, and why must you open the .xcworkspace afterwards?

level: juniorimportance: must knowfreq 62%
basics
~20 s

pod 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.

open as a page

In a React Native app, why is process.env.API_URL undefined at runtime, and how do per-environment values actually reach the JavaScript?

level: middleimportance: must knowfreq 58%
basics
~20 s

React 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.

open as a page

In a React Native TypeScript app, what turns .tsx into JavaScript for Metro, and why can the app run with type errors?

level: middleimportance: must knowfreq 55%
basics
~10 s

Metro 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.

open as a page

How do you upgrade a bare React Native app to a new version, and what does the Upgrade Helper give you?

level: middleimportance: must knowfreq 58%
basics
~20 s

Bump 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.

open as a page

Why does a React Native debug build on a USB-connected Android phone need adb reverse tcp:8081 tcp:8081 to reach Metro?

level: juniorimportance: must knowfreq 50%
basics
~20 s

On 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.

open as a page

In React Native, how do you open the Dev Menu on the iOS Simulator, an Android emulator and a device, and what does it offer?

level: juniorimportance: must knowfreq 50%
basics
~20 s

Open the React Native Dev Menu with Ctrl+Cmd+Z on the iOS Simulator, Cmd+M or Ctrl+M on an Android emulator, a shake on a device, adb shell input keyevent 82, or d in Metro. It offers reload, DevTools, Fast Refresh and inspector toggles in development builds only.

open as a page

In a React Native 0.87 app, how do you open React Native DevTools, and what do its main panels let you do?

level: juniorimportance: must knowfreq 62%
basics
~20 s

Press 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.

open as a page

In React Native, what does Fast Refresh keep when you save an edit, and when does it fall back to a full reload instead?

level: juniorimportance: must knowfreq 60%
basics
~20 s

Fast 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.

open as a page

In a React Native release build, why does a JavaScript crash stack show frames like p@1:132161 instead of your file and line?

level: juniorimportance: must knowfreq 46%
basics
~20 s

A 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.

open as a page

In React Native, why does an Image with a require() source appear without a size while a remote uri Image renders blank?

level: juniorimportance: must knowfreq 72%
basics
~20 s

A 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.

open as a page

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?

level: juniorimportance: must knowfreq 58%
basics
~20 s

resizeMode 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.

open as a page

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?

level: juniorimportance: must knowfreq 58%
basics
~10 s

Core 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.

open as a page

Why does a React Native Switch snap back after the user toggles it, and how do value and onValueChange fix it?

level: juniorimportance: must knowfreq 45%
basics
~20 s

React 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.

open as a page

In React Native, why do teams build custom buttons with Pressable instead of the core Button or the Touchable* components?

level: juniorimportance: must knowfreq 66%
basics
~20 s

Core 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.

open as a page

What is FlashList in React Native, and how does its cell recycling differ from FlatList's virtualization?

level: juniorimportance: must knowfreq 52%
basics
~20 s

FlashList (@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.

open as a page

In a React Native FlatList, what does keyExtractor do, and which key does the list use when you omit it?

level: juniorimportance: must knowfreq 72%
basics
~20 s

keyExtractor 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.

open as a page

How do you add pull-to-refresh to a React Native FlatList, and what do its refreshing and onRefresh props do?

level: juniorimportance: must knowfreq 62%
basics
~20 s

Passing 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.

open as a page

In a React Native SectionList, what shape must the sections prop have, and what do renderItem and renderSectionHeader receive?

level: juniorimportance: must knowfreq 55%
basics
~20 s

A 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.

open as a page

In a React Native FlatList, why can rows ignore a state change such as a selected contact, and what does extraData fix?

level: middleimportance: must knowfreq 58%
basics
~20 s

FlatList 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.

open as a page

In React Native, what unit is a style value such as width: 120, and how does PixelRatio map it to physical pixels?

level: juniorimportance: must knowfreq 66%
basics
~20 s

Style 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.

open as a page

In a bare React Native project, what must you do so a bundled .ttf file can be used through the Text fontFamily style?

level: juniorimportance: must knowfreq 55%
basics
~10 s

Copy 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.

open as a page

In React Native, how do you apply a conditional style such as a disabled coupon card, and which style wins when entries conflict?

level: juniorimportance: must knowfreq 68%
basics
~20 s

React 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.

open as a page

What does StyleSheet.create do in React Native 0.87, and how does it differ from passing an inline style object?

level: juniorimportance: must knowfreq 64%
basics
~20 s

In 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.

open as a page

In React Native, how does useColorScheme report the system light or dark setting, and why prefer it over Appearance.getColorScheme()?

level: juniorimportance: must knowfreq 68%
basics
~10 s

useColorScheme 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.

open as a page

In React Native, how does Metro pick between DatePicker.ios.tsx, DatePicker.android.tsx and DatePicker.native.tsx for an import of './DatePicker'?

level: juniorimportance: must knowfreq 58%
basics
~10 s

Import 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.

open as a page

In React Native, what do Platform.OS and Platform.select return, and how does Platform.select choose between ios, android, native and default keys?

level: juniorimportance: must knowfreq 70%
basics
~20 s

Platform.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.

open as a page

In React Native, how does BackHandler decide whether an Android back press is handled by your code or exits the app?

level: middleimportance: must knowfreq 62%
basics
~20 s

BackHandler 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.

open as a page

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?

level: middleimportance: must knowfreq 55%
basics
~20 s

elevation 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.

open as a page

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?

level: middleimportance: must knowfreq 55%
basics
~20 s

React 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.

open as a page

In React Native, what does a screen reader announce for an icon-only Pressable without accessibilityLabel, and how do accessibilityLabel and accessibilityHint fix it?

level: juniorimportance: must knowfreq 68%
basics
~20 s

React 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.

open as a page

In React Native, how does Text react to the system font size setting, and what do allowFontScaling and maxFontSizeMultiplier change?

level: juniorimportance: must knowfreq 48%
basics
~10 s

Text 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.

open as a page

In React Native, how do announceForAccessibility and accessibilityLiveRegion differ for telling screen-reader users a money transfer completed?

level: middleimportance: must knowfreq 48%
basics
~20 s

AccessibilityInfo.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.

open as a page

In React Native, what is the difference between accessibilityState and accessibilityValue, and how does a disabled Pressable get announced as disabled?

level: middleimportance: must knowfreq 52%
basics
~20 s

accessibilityState 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.

open as a page

In React Native, how do you make a swipe-to-archive email row usable for VoiceOver and TalkBack users who cannot perform the swipe?

level: seniorimportance: must knowfreq 40%
basics
~10 s

Declare 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.

open as a page

In React Native, how do you animate a like-button heart pop with Animated.spring, and what does useNativeDriver: true change?

level: juniorimportance: must knowfreq 75%
basics
~10 s

Keep 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.

open as a page

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?

level: middleimportance: must knowfreq 62%
basics
~20 s

By 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.

open as a page

In React Native Gesture Handler 3, when do you use useSimultaneousGestures, useExclusiveGestures and useCompetingGestures to combine gestures on one view?

level: middleimportance: must knowfreq 45%
basics
~20 s

useSimultaneousGestures 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.

open as a page

In React Native, why does a Gesture Handler pan keep tracking the finger while the JavaScript thread is busy, when a PanResponder drag stalls?

level: middleimportance: must knowfreq 55%
basics
~20 s

Gesture 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.

open as a page

In Reanimated 4, how do useSharedValue and useAnimatedStyle move a view on every frame without re-rendering the React component?

level: middleimportance: must knowfreq 62%
basics
~20 s

A shared value is a mutable container kept in sync between the JS and UI runtimes. useAnimatedStyle's updater is a UI-runtime worklet that re-runs when a shared value it reads changes, so view props update without a React render.

open as a page

With React Navigation 7, why should a telehealth app render signed-in and signed-out screens conditionally instead of calling navigate('Home') after sign-in?

level: juniorimportance: must knowfreq 66%
basics
~20 s

In React Navigation 7 the rendered screen list is the auth gate: when auth state flips, the old screens' routes are dropped and the first new screen shows, so no sign-in history survives and signed-out users cannot reach protected screens.

open as a page

In a React Navigation 7 stack, what happens to the product list screen when you push a details screen, and when does it unmount?

level: juniorimportance: must knowfreq 70%
basics
~20 s

Pushing a details screen keeps the product list mounted underneath with its state intact; it only receives a blur event. It unmounts when its route is removed from the stack state: going back past it, replace or reset.

open as a page

In React Navigation 7, when do you use a stack navigator, bottom tabs or a drawer to organise an app's screens?

level: juniorimportance: must knowfreq 72%
basics
~20 s

Use a stack for drill-down flows where screens are pushed and popped as history, bottom tabs for a few top-level peer sections that each keep their state, and a drawer when there are more peer destinations than fit in a tab bar.

open as a page

In React Navigation 7, what changes when a stack is nested inside each tab versus the whole tab navigator being nested inside a stack?

level: juniorimportance: must knowfreq 58%
basics
~20 s

A stack inside a tab gives that tab its own history and keeps the tab bar visible; tabs inside a stack let root-stack screens cover the tab bar. Most apps combine both: per-tab stacks inside a root stack.

open as a page

With React Navigation 7, how do you pass an order id to a delivery-tracking screen and read it inside that screen?

level: juniorimportance: must knowfreq 76%
basics
~10 s

Call navigation.navigate('Tracking', { orderId }), where the second argument is the params object, then read route.params.orderId in the Tracking screen, or call useRoute() from any component rendered inside that screen.

open as a page

In React Native, how do Linking.getInitialURL() and Linking.addEventListener('url', …) differ, and why does an app need both?

level: juniorimportance: must knowfreq 60%
basics
~20 s

Linking.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.

open as a page

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?

level: juniorimportance: must knowfreq 60%
basics
~20 s

React 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.

open as a page

In a bare React Native app, how do you register a custom URL scheme like resetapp:// on iOS and Android?

level: middleimportance: must knowfreq 50%
basics
~20 s

Register 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.

open as a page

In a React Native app, what must the website and the native projects configure so iOS Universal Links and Android App Links verify?

level: middleimportance: must knowfreq 55%
basics
~10 s

The 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.

open as a page

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?

level: juniorimportance: should knowfreq 38%
basics
~20 s

Expo'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.

open as a page

With expo-notifications, how do you schedule a daily local medication reminder in a React Native app, and which trigger types exist?

level: juniorimportance: must knowfreq 50%
basics
~10 s

Call 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.

open as a page

With expo-notifications, why does a push not appear while the React Native app is open, and what does setNotificationHandler change?

level: juniorimportance: must knowfreq 52%
basics
~10 s

In 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.

open as a page

In a React Native app, how does asking for push notification permission differ between iOS and Android 13 or later?

level: juniorimportance: must knowfreq 62%
basics
~20 s

iOS 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.

open as a page

In a React Native app, what is a push device token, and which provider issues it on iOS and on Android?

level: juniorimportance: must knowfreq 60%
basics
~20 s

A 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.

open as a page

In a React Native app on Android, why does changing an existing notification channel's importance or sound have no effect?

level: middleimportance: must knowfreq 42%
basics
~20 s

Once 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.

open as a page

In a React Native app on the Android emulator, why does fetch('http://localhost:3000/api') fail, and which address reaches your development machine?

level: juniorimportance: must knowfreq 62%
basics
~20 s

On 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.

open as a page

In React Native, how do you read the network state once and subscribe to its changes with NetInfo's fetch, addEventListener and useNetInfo?

level: juniorimportance: must knowfreq 45%
basics
~20 s

NetInfo.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.

open as a page

In a React Native screen, how do you open a WebSocket, handle its onopen, onmessage and onclose events, and close it cleanly?

level: juniorimportance: must knowfreq 48%
basics
~20 s

Create 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.

open as a page

Why does a React Native app's fetch call never fail with a CORS error, when the same request from a web page does?

level: middleimportance: must knowfreq 52%
basics
~20 s

CORS 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.

open as a page

With React Native's NetInfo, what is the difference between isConnected and isInternetReachable, and which should drive an offline banner?

level: middleimportance: must knowfreq 55%
basics
~20 s

isConnected 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.

open as a page

In React Native, what do the AppState values active, background and inactive mean, and how do you subscribe to changes?

level: juniorimportance: must knowfreq 62%
basics
~10 s

React 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.

open as a page

In an offline-capable React Native app, why must pending writes go into a persisted outbox rather than memory, and when is it replayed?

level: juniorimportance: must knowfreq 40%
basics
~20 s

Pending 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.

open as a page

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?

level: middleimportance: must knowfreq 55%
basics
~20 s

AsyncStorage 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.

open as a page

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?

level: middleimportance: must knowfreq 58%
basics
~20 s

Every 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.

open as a page

With expo-task-manager in a React Native app, why must TaskManager.defineTask be called at module top level rather than inside a component?

level: juniorimportance: should knowfreq 22%
basics
~20 s

When 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.

open as a page

In a React Native app, why is an API key read from a .env file or an EXPO_PUBLIC_ variable not actually secret?

level: juniorimportance: must knowfreq 66%
basics
~20 s

The 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.

open as a page

In a React Native app, where should a refresh token be stored, and why is AsyncStorage the wrong place for it?

level: juniorimportance: must knowfreq 78%
basics
~20 s

A 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.

open as a page

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?

level: juniorimportance: must knowfreq 58%
basics
~20 s

WebBrowser.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.

open as a page

In a React Native Android app, how do you request the camera permission with PermissionsAndroid, and what can the request resolve to?

level: juniorimportance: must knowfreq 58%
basics
~10 s

Call 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.

open as a page

With expo-auth-session, how do useAuthRequest, promptAsync and exchangeCodeAsync fit together in an authorization-code sign-in with PKCE?

level: middleimportance: must knowfreq 55%
basics
~10 s

useAuthRequest 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.

open as a page

In React Native, how do you clean up an AppState listener and a setInterval inside useEffect, and what leaks if you forget?

level: juniorimportance: must knowfreq 58%
basics
~20 s

Keep 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.

open as a page

Why can console.log calls slow a React Native release build, and how do you strip them with babel-plugin-transform-remove-console?

level: juniorimportance: must knowfreq 58%
basics
~20 s

React 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.

open as a page

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?

level: middleimportance: must knowfreq 62%
basics
~20 s

The 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.

open as a page

Why do performance numbers from a React Native debug build mislead you, and which build should you profile instead?

level: middleimportance: must knowfreq 62%
basics
~20 s

A 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.

open as a page

In React Native, why do eager screen imports and module side effects lengthen cold start, and how do lazy-loaded screens help?

level: middleimportance: must knowfreq 52%
basics
~20 s

Every 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.

open as a page

In a React Native 0.87 app, what does @react-native/jest-preset configure, and why can't plain Jest run React Native code?

level: juniorimportance: must knowfreq 55%
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.

open as a page

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?

level: middleimportance: must knowfreq 60%
basics
~10 s

Jest 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.

open as a page

What can a React Native component test under Jest and React Native Testing Library not see that a device test can?

level: middleimportance: must knowfreq 58%
basics
~20 s

A 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.

open as a page

In React Native Jest tests, why does a screen using a custom location TurboModule fail on import, and how do you mock it?

level: middleimportance: must knowfreq 55%
basics
~20 s

Under 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.

open as a page

In React Native Jest tests, what is Platform.OS by default, and how do you test a component's Android branch?

level: juniorimportance: should knowfreq 38%
basics
~20 s

Platform.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.

open as a page

In a React Native Android release, what is the difference between an AAB and an APK, and which one does Google Play expect?

level: juniorimportance: must knowfreq 65%
basics
~20 s

An 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.

open as a page

What changes when a React Native iOS app is built with Xcode's Release configuration instead of Debug?

level: juniorimportance: must knowfreq 60%
basics
~20 s

A 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.

open as a page

How do you sign a React Native Android release with your own upload keystore instead of the template's debug keystore?

level: middleimportance: must knowfreq 55%
basics
~20 s

Generate 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.

open as a page

In a React Native CI pipeline, how do you get the Android upload keystore and iOS signing assets into the build without committing them?

level: middleimportance: must knowfreq 55%
basics
~10 s

Store 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.

open as a page

For a React Native iOS release, what do the distribution certificate and the App Store provisioning profile each do when you archive and upload?

level: middleimportance: must knowfreq 55%
basics
~20 s

The 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.

open as a page