Topic #59Advanced5 min read

React Native / Cross-Platform

Build iOS + Android apps with React: same patterns, native rendering targets instead of the DOM.

#react-native#cross-platform#mobile#expo

React Native lets you build mobile apps (iOS + Android) using React. Your React knowledge transfers: components, hooks, state, and most libraries work the same. The key difference is the rendering target: instead of DOM elements (<div>, <p>), you use native components (<View>, <Text>, <ScrollView>).

Expo simplifies React Native development by handling native build configuration, providing pre-built APIs (camera, notifications, file system), and enabling over-the-air updates. If a team ships a mobile app, React Native + Expo is the natural path from existing React web skills.

Key Insights
  • Your React mental model transfers directly — components, hooks, state, props — only the primitives change.
  • There is no DOM: use <View>, <Text>, <ScrollView> and StyleSheet objects instead of div/p and CSS files.
  • Expo removes most native toolchain friction and adds device APIs plus over-the-air updates.

Worked Code

React Native: same React patterns, native rendering
TSX
// React Native looks very similar to React
import { View, Text, TouchableOpacity, StyleSheet } from 'react-native';

function ExpenseCard({ title, amount }: CardProps) {
  return (
    <View style={styles.card}>
      <Text style={styles.title}>{title}</Text>
      <Text style={styles.amount}>{amount}</Text>
    </View>
  );
}

const styles = StyleSheet.create({
  card: { padding: 16, borderRadius: 8, backgroundColor: '#fff', shadowColor: '#000', shadowOpacity: 0.1, elevation: 2 },
  title: { fontSize: 16, fontWeight: 'bold' },
  amount: { fontSize: 20, color: '#1B4F72' },
});

Interview-Ready Q&A

Your logic layer shares cleanly — hooks, state management, API/data-fetching code, validation, and most pure utility libraries are platform-agnostic. What does not share is the rendering layer: web uses DOM elements and CSS, while React Native uses native primitives (View, Text, ScrollView) and StyleSheet objects. So you typically share business logic and component behavior but write platform-specific presentational components, sometimes splitting files by .native.tsx / .web.tsx extension.

Things to Remember
  • 1React Native = React patterns with native rendering; no DOM, no CSS — use View/Text and StyleSheet.
  • 2Logic and hooks port across web and native; presentational components usually don't.
  • 3Expo manages native config, device APIs, and over-the-air updates.

References & Further Reading