React Native
A framework for building iOS and Android apps with React. You can share application logic and screens written in JavaScript or TypeScript while displaying native UI rather than a web page.
What React Native lets you share
Suppose you're building an order history screen for iOS and Android. Both versions need to fetch orders, handle loading and errors, and display the results. React Native lets you write that logic and much of the screen once. The result is a mobile app with native UI, not a website running inside a WebView. Sharing code doesn't mean the two apps must look or behave exactly alike.
From JSX to the screen
The React programming model carries over: components take props, hold state, and describe what the UI should look like. The pieces you render are different. On the web, React can update the browser's DOM. In React Native, components such as View and Text are rendered through React Native's native renderer. JavaScript runs in an engine such as Hermes; it isn't running in a browser, and TypeScript types aren't present at runtime.
Styles are JavaScript objects rather than browser stylesheets. Layout uses Flexbox concepts, but some defaults differ from the web: children stack vertically unless you change flexDirection. If you need a device feature that your app can't access through its existing JavaScript APIs, such as a particular camera capability, you can use a library that exposes it through a native module or implement a module yourself.
Example: expanding a delivery note
import { useState } from 'react';
import { Button, Text, View } from 'react-native';
export default function DeliveryNote() {
const [expanded, setExpanded] = useState(false);
return (
<View>
<Button
title={expanded ? 'Hide note' : 'Show note'}
onPress={() => setExpanded(value => !value)}
/>
{expanded && <Text>Leave the package at reception.</Text>}
</View>
);
}
The same onPress handler drives the interaction on both platforms. React uses the updated state to decide whether to show the note, while the button's appearance can differ by platform.
Where the shared code ends
React Native is useful when apps share workflows but still need to integrate with each operating system. A checkout flow can be mostly shared, for example, while a payment integration may require different configuration on iOS and Android. When a component needs two implementations, platform-specific files such as Checkout.ios.tsx and Checkout.android.tsx can keep those differences out of the shared code. Build and test each platform separately. Expo provides tooling and libraries for React Native projects; using it doesn't turn the app into a WebView.
What interviewers ask
A typical question is what you'd do if a long feed scrolls poorly. Start by distinguishing ScrollView, which renders all its children, from FlatList, which virtualizes the list by rendering a limited window around the visible rows. Then explain what you'd measure if performance is still poor: for example, check whether a single update causes many rows to re-render, rather than assuming that adding memoization will fix the problem.