Expo/React Native patterns for MathMind and Arena mobile — navigation, NativeWind, performance, offline-first, push notifications, App Store deployment, security.
Expo / React Native Patterns
Review Checklist
expo-image used (not Image from react-native)
FlatList for lists >20 items (not ScrollView)
Sensitive data in expo-secure-store (not AsyncStorage)
SafeAreaView or useSafeAreaInsets() on every screen
Animations use react-native-reanimated (UI thread, 60fps)
Push notification permission requested at appropriate time
Offline state handled gracefully
Deep links tested on both iOS and Android
Platform Differences from Web
Web
React Native
<div>
<View>
<span>, <p>
<Text> (text MUST be in <Text>)
<button>
<Pressable>
<img>
<Image> from expo-image
CSS classes
StyleSheet.create() or NativeWind
Flexbox (row default)
Flexbox (column default)
window.localStorage
AsyncStorage (unencrypted) or expo-secure-store (encrypted)
// ❌ AsyncStorage is UNENCRYPTED — visible to anyone with device access
import AsyncStorage from '@react-native-async-storage/async-storage'
await AsyncStorage.setItem('auth_token', token) // INSECURE
// ✅ expo-secure-store uses iOS Keychain / Android Keystore
import * as SecureStore from 'expo-secure-store'
await SecureStore.setItemAsync('auth_token', token) // ENCRYPTED
What Goes Where
Data
Storage
Why
Auth tokens
expo-secure-store
Encrypted, OS-protected
User preferences
AsyncStorage
Not sensitive
Cached API data
AsyncStorage
Not sensitive, needs fast access
Problem history (MathMind)
expo-sqlite
Structured, offline-queryable
Encryption keys
expo-secure-store
Maximum protection
Offline-First Pattern (MathMind)
// 1. Try network, fall back to cache
async function getProblems(grade: number) {
try {
const online = await NetInfo.fetch()
if (online.isConnected) {
const data = await fetchFromSupabase(grade)
await cacheLocally(grade, data) // update cache
return data
}
} catch {} // network failed
return getCachedProblems(grade) // offline fallback
}
// 2. Queue mutations for sync
async function submitAnswer(answer: Answer) {
await saveToLocalDb(answer) // always save locally first
const online = await NetInfo.fetch()
if (online.isConnected) {
await syncToSupabase(answer)
} else {
await addToSyncQueue(answer) // sync when back online
}
}
App Store Deployment
# Build for production
eas build --platform ios --profile production
# Submit to App Store
eas submit --platform ios
# OTA update (JS-only changes, no native module changes)
eas update --branch production --message "Fix scoring display"
MathMind-Specific Considerations
Kids Category: requires COPPA compliance, no third-party analytics, no behavioral ads
Age rating: educational content, no user-generated content = likely 4+
Login for reviewer: provide test credentials in App Store Connect
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.