Build Mobile Apps using React + JavaScript
React Native is a framework by Meta (Facebook) used to build Android and iOS apps using JavaScript and React.
- One codebase → Android + iOS - Uses React knowledge - Fast development - Huge job demand
import React from 'react';
import { Text, View } from 'react-native';
export default function App() {
return (
<View>
<Text>Hello React Native</Text>
</View>
);
}
View → Container Text → Text display Image → Show images Button → Click actions ScrollView → Scrolling
import { StyleSheet } from 'react-native';
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center'
}
});
import React, { useState } from 'react';
import { Text, Button } from 'react-native';
export default function App() {
const [count, setCount] = useState(0);
return (
<>
<Text>Count: {count}</Text>
<Button title="Increase" onPress={() => setCount(count + 1)} />
</>
);
}
React Navigation: - Stack Navigation - Tab Navigation - Drawer Navigation
fetch('https://api.example.com')
.then(res => res.json())
.then(data => console.log(data));
- AsyncStorage (local storage) - Firebase (cloud database)