Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Take A QuizChallenge yourself and boost your learning! Start the quiz now to earn credits.
Take A QuizUnlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
Take A Quiz
🧭 What You’ll Learn
By the end of this chapter, you’ll be able to:
🧹 Step 1: Code Cleanup
and Folder Organization
✅ Structure Your Project Like
This:
bash
/assets
└─ icons/
└─ backgrounds/
└─ animations/
/components
└─ Header.js
└─ WeatherCard.js
└─ ThemeToggle.js
/api
└─ weatherService.js
/constants
└─ theme.js
└─ colors.js
/screens
└─ HomeScreen.js
/App.js
This makes your project easier to maintain, scale, and
debug.
⚙️ Step 2: Reusable Styles and
Constants
🔹 Create
/constants/colors.js
js
export
const colors = {
light: {
background: '#f8fafc',
text: '#0f172a',
},
dark: {
background: '#1e293b',
text: '#f1f5f9',
},
sunny: '#fef08a',
rainy: '#bae6fd',
cloudy: '#e5e7eb',
};
🔹 Reuse in Components
js
import
{ colors } from '../constants/colors';
<Text
style={{ color: colors.light.text }}>Weather</Text>
🚀 Step 3: App Icon and
Splash Screen (Expo)
✅ Replace default assets
✅ Update app.json
json
{
"expo": {
"name": "WeatherNow",
"slug": "weathernow",
"icon":
"./assets/icon.png",
"splash": {
"image":
"./assets/splash.png",
"resizeMode":
"contain",
"backgroundColor":
"#ffffff"
}
}
}
📈 Step 4: Performance
Optimization
✅ Reduce Re-renders
✅ Lazy Load Components
jsx
const
WeatherCard = React.lazy(() => import('./components/WeatherCard'));
<Suspense
fallback={<ActivityIndicator />}>
<WeatherCard />
</Suspense>
✅ Optimize Image Loading
✅ Bundle Optimization (CLI)
Use metro.config.js to exclude unused modules, fonts, or assets.
📦 Step 5: Generate
Production Build with Expo
🔹 Install EAS CLI
bash
npm install -g eas-cli
eas login
🔹 Configure eas.json
json
{
"build": {
"development": {
"developmentClient": true,
"distribution":
"internal"
},
"preview": {
"distribution":
"internal"
},
"production": {
"android": {
"buildType": "apk"
},
"ios": {
"buildType":
"app-store"
}
}
}
}
🔹 Build
bash
eas
build -p android --profile production
eas
build -p ios --profile production
🛠 Optional: React Native
CLI Build
Use this if you ejected from Expo or started with
CLI.
bash
npx
react-native run-android
npx
react-native run-ios
Generate signed APK or AAB for Play Store:
bash
cd
android
./gradlew
assembleRelease
🧪 Step 6: Test on
Multiple Devices
Method |
Purpose |
Expo Go App |
Live preview on real
device |
Android Emulator |
Desktop
testing |
Physical Devices |
Real-world performance |
TestFlight |
iOS beta
distribution |
🌍 Step 7: Deploy to Play
Store and App Store
✅ Android – Play Store
✅ iOS – App Store
🚀 Publish With EAS
bash
eas
submit --platform android
eas
submit --platform ios
Follow on-screen prompts to upload credentials.
📋 Table: EAS vs React
Native CLI
Feature |
Expo EAS |
React Native CLI |
Build Complexity |
Low (managed workflow) |
Medium-High |
Native Access |
Limited (unless
ejected) |
Full |
App Store Builds |
Yes (using EAS Submit) |
Yes (Xcode, Gradle
required) |
Best For |
Beginners,
cross-platform |
Advanced
devs, custom modules |
🧠 Final App Review
Checklist
Task |
Done? ✅ |
App name, icon,
splash screen updated |
|
All screens tested on mobile/emulator |
|
Input validated
with error feedback |
|
Linting and formatting applied |
|
Bundle optimized
for performance |
|
Debug logs removed |
|
Privacy policy +
screenshots ready |
✅ Summary
You’ve just completed the journey of:
Congratulations! 🎉 Your app is now production-ready
and can reach users worldwide!
Answer:
While React Native shares many concepts with React (like components, props, and
state), you don’t need to be an expert in React to start. Basic knowledge of
JavaScript and understanding of components will help you get going quickly.
Answer:
Expo is a framework and platform that simplifies React Native
development. It’s great for beginners.
React Native CLI provides full native access and is preferred for
advanced, production-grade apps. For this weather app, Expo is usually enough.
Answer:
You can use any public weather API, but OpenWeatherMap is
beginner-friendly, well-documented, and offers a free tier with real-time
weather data, making it ideal for this project.
Answer:
Yes! React Native apps work on both Android and iOS. You’ll be building
one codebase that runs on both platforms with native-like performance.
Answer:
Absolutely. React Native supports location access through packages like
expo-location or react-native-geolocation-service, which lets you fetch the
user’s coordinates and use them in your API requests.
Answer:
No. Most APIs like OpenWeatherMap offer a free tier that includes
current weather data, which is enough for this app. Just sign up and grab your
API key from their dashboard.
Answer:
This app uses React Hooks—mainly useState for managing input and weather
data, and useEffect for API calls. For more advanced apps, you might consider
using context or libraries like Redux.
Answer:
React Native uses the StyleSheet.create() method to define CSS-like styles. You
can also use Flexbox for layout and third-party libraries like
react-native-elements or styled-components for more flexibility.
Answer:
Yes, with additional steps. You’ll need to create a developer account for each
store, build release versions, test thoroughly, and follow each platform’s
publishing guidelines. Expo also offers services like EAS Build to
simplify deployment.
Answer:
You can add features like:
These upgrades help turn a simple app into a portfolio-level
project.
Please log in to access this content. You will be redirected to the login page shortly.
LoginReady to take your education and career to the next level? Register today and join our growing community of learners and professionals.
Comments(0)