Complete solution (100% reference)
index.html- Main HTML pagescript.js- JavaScript logicstyles.css- Styling and layoutpackage.json- Dependenciessetup.sh- Setup scriptREADME.md- Instructions (below)๐ก Download the ZIP, extract it, and follow the instructions below to get started!
Learn to display large datasets efficiently with FlatList, search, and pull-to-refresh.
# 1. Install dependencies
npm install --legacy-peer-deps
# 2. Start Expo
npx expo start
# 3. Scan QR code with Expo Go app
Complete these 3 TODOs in screens/BrowseScreen.js:
Replace ScrollView with FlatList for efficient rendering of large datasets.
Key Concepts:
renderItem: Function that renders each itemkeyExtractor: Returns unique key for each itemnumColumns={2}: Creates 2-column grid layoutListEmptyComponent: Shows when no dataAdd real-time search filtering using the pre-built filterByQuery() helper.
Key Concepts:
filteredData stateAdd pull-to-refresh functionality using RefreshControl.
Key Concepts:
refreshing state controls spinneronRefresh functionactivity-08-data-cards/
โโโ App.js # Main entry (100% complete)
โโโ screens/
โ โโโ BrowseScreen.js # YOUR WORK HERE (40% complete)
โโโ components/ # All 100% complete - Use as is
โ โโโ DataCard.js # Product card component
โ โโโ SearchBar.js # Search input
โ โโโ EmptyState.js # No results message
โโโ data/
โ โโโ sampleData.js # 24 sample products
โโโ utils/
โ โโโ searchHelpers.js # Filter functions
โโโ styles/
โโโ colors.js # Design system
โ DataCard component with professional styling โ SearchBar with clear button โ EmptyState for no results โ 24 sample products with emoji images โ Search helper functions โ Complete design system
After each TODO:
TODO #1:
TODO #2:
TODO #3:
Metro bundler error:
npx expo start --clear
Module not found:
rm -rf node_modules package-lock.json
npm install --legacy-peer-deps
App not loading on phone:
w in terminalWhen complete:
Tech Stack: React 19.0.0 | React Native 0.79.5 | Expo SDK ~53.0.0