In Class 1, everything was in one App.tsx. Now we're upgrading to a real app structure:
SolScan/
├── App.tsx ← NEW: Tab bar + screen switching
├── src/
│ └── screens/
│ ├── WalletScreen.tsx ← Your Class 1 code, moved here
│ └── SwapScreen.tsx ← NEW: Token swap UI
npx expo install react-native-safe-area-context
react-native-safe-area-context is the production-grade version of SafeAreaView. The one from react-native is iOS-only and limited. This package works on both iOS and Android. Every real app uses this.
@expo/vector-icons comes pre-installed with Expo, gives us Ionicons, FontAwesome, MaterialIcons, etc.
Create the folder src/screens/ and create WalletScreen.tsx inside it.
Take your entire Class 1 code and paste it in. The only two changes:
export default function App() → export function WalletScreen()SafeAreaView wrapper, the parent App.tsx will handle that nowThat's it. Same RPC functions, same helpers, same JSX, same styles. Just in a new file with a named export.
Named export vs default export:
// Named export (WalletScreen.tsx) — import with curly braces
export function WalletScreen() { ... }
import { WalletScreen } from "./src/screens/WalletScreen";
// Default export (App.tsx) — import without curly braces
export default function App() { ... }
import App from "./App";