React Native Notes
React Native Notes
Core Concepts
Components
Everything is a component.
function App() {
return <Text>Hello World</Text>;
}
JSX
<Text>Hello</Text>
Props
State
Re-render
setCount(count + 1);
Common Components
View
Equivalent of a div.
<View>
<Text>Hello</Text>
</View>
Text
<Text>Welcome</Text>
Image
<Image source={{ uri: imageUrl }} />
TextInput
<TextInput
value={name}
onChangeText={setName}
/>
Button
<Button
title="Submit"
onPress={handleSubmit}
/>
ScrollView
<ScrollView>
{/* Content */}
</ScrollView>
FlatList
<FlatList
data={users}
renderItem={({ item }) => (
<Text>{[Link]}</Text>
)}
/>
Page 2 — Hooks, Styling & Navigation
useState
const [name, setName] = useState("");
Used for:
● Inputs
● Toggles
● Counters
● UI state
useEffect
Runs side effects.
useEffect(() => {
fetchUsers();
}, []);
Common uses:
● API calls
● Timers
● Event listeners
Styling
const styles = [Link]({
container: {
flex: 1,
padding: 20
}
});
Usage:
Flexbox
Column (default)
{
flexDirection: "column"
}
Row
{
flexDirection: "row"
}
Center
{
justifyContent: "center",
alignItems: "center"
}
Navigation
Install
npm install @react-navigation/native
Stack Navigation
[Link]("Profile");
Go Back
[Link]();
Navigation Types:
1. Stack
2. Tabs
3. Drawer
Page 3 — APIs, State Management & App
Architecture
Fetch API
const getUsers = async () => {
const res = await fetch(url);
const data = await [Link]();
};
AsyncStorage
Store data locally.
await [Link](
"token",
token
);
Read:
const token =
await [Link]("token");
Global State
Context API
Good for:
● Theme
● User info
● Auth
Zustand
const useStore = create((set) => ({
count: 0,
increment: () =>
set((state) => ({
count: [Link] + 1
}))
}));
Good for:
Folder Structure
src/
│
├── screens/
├── components/
├── navigation/
├── services/
├── store/
├── hooks/
├── utils/
├── assets/
└── [Link]
● Components
● Props vs State
● useState
● useEffect
● FlatList
● Flexbox
● Navigation
● API Calls
● AsyncStorage
● Context API
● Zustand
● Expo basics
Recommended Learning Order
1. JavaScript ES6
2. React Basics
3. Components
4. Props
5. State
6. Hooks
7. Styling
8. Flexbox
9. Lists
10. Forms
11. Navigation
12. APIs
13. AsyncStorage
14. Authentication
15. Zustand
16. Expo
17. App Deployment
✅ Components
✅ JSX
✅ Props
✅ State
✅ useEffect
✅ Styling
✅ Flexbox
✅ FlatList
✅ Navigation
✅ APIs
✅ AsyncStorage
✅ Authentication
✅ Zustand
✅ Expo
✅ Deployment
Once these are comfortable, you're ready to build production apps such as social apps,
SaaS apps, marketplaces, games, and subscription-based products.