Edu-React-Native-PTT.G01
- React Native
- Components
- export - import - as
- Folder Structure
- ES7+ React/Redux/React-Native snippets | React Native Snippet | Prettier - Code formatter
- Styles
- View - Text
- Commands
Create React Project
npx react-native init [Project-Name]
Start Metro
npm run start
Deploy to Device
npm run ios / npm run android
Exit Terminal
CTRL + C
- Props
- Flex - flexDirection
- State
- Counter
- Summary
- Create First App
- Create JS/JSX App
npx create-react-native-app [Project-Name]
- Create TS/TSX App
npx react-native init [Project-Name]
- Button (title | onPress | color | disabled)
- Event Handler/Bind
- Alert.alert('XXXX') | Alert.prompt('title','msg',func) -> IOS
- Image (source->{require} | @2x @3x @4x | source->{{uri}})
- resizeMode (contain, cover, center, repeat, stretch )
- style {{width-height}}
- Touchables => TouchableOpacity & TouchableHighlight & TouchableWithoutFeedback
- TextInput (onChangeText, value, placeholder, style, secureTextEntry={true}, editable={false}, keyboardType='number-pad', autoCapitalize='characters') IOS Keyboard Show => SHIFT+CMD+K | SHIFT+CTRL+K
- ScrollView (horizontal={true},pagingEnabled={true} ) -> ListView
- Dimensions Dimensions.get('window').width | Dimensions.get('window').height; Dimensions.addEventListener('change', onChange); Dimensions.removeEventListener('change', onChange);
- SafeAreaView
- Platform Based Components .ios/.android | Platform.OS - (ios - android) | Platform.Version Style Sample=> https://reactnative.dev/docs/platform-specific-code
- Class Component + Function Comp
- LifeCycle -> useEffect
- Hooks -> useState & useEffect
- Fetch
- Axios
npm i axios
BUG FIXED: Address already in use :::8081 (SOLUTION)[https://medium.com/@fdikmen/react-nativede-port-çakışması-sorunu-ve-çözümü-10d2306acaec]
- Summary
- Axios
- Deprecated => npx react-native init LessonProject --platform ios | npx react-native init LessonProject --skip android
- Dimensions.get('screen').width vs Dimensions.get('window').width
- Spread Operator (...)
- Platform.Select
- ActivityIndicator
- Custom API => POSTMAN
- FlatList (data | renderItem | keyExtractor | listEmptyComponent | ListHeaderComponent ) TSX => type User useState[] renderItem keyExtractor
- PhoneBook (Props, UseState, UseEffect, Axios, SafeAreaView, View, TextInput, FlatList, ActivityIndicator, Text, StyleSheet, Image)
npx react-native init phonebook
- User.ts UserItem.ts (tsrnfs with snippet)
- SafeAreView
- useState, useEffect, users[], axios.get-> https://647f231bc246f166da9026e4.mockapi.io/users
- Children
-
Summary
-
ErrorBoundary (getDerivedStateFromError | componentDidCatch)
-
ContextAPI
-
Navigation Drawer | Tab | Stack | Nesting
-
Comment => CMD/CTRL + K + C => UnComment => CMD/CTRL + K + U
-
jamfnow => (Local IOS Deploy)
-
Debuging => 1.Native IDE (Xcode & AStudio) 2. Console Msg 3. localhost:8081 4. Terminal(Metro)
- Summary
- SafeAreaView X [npm install react-native-screens react-native-safe-area-context] .ts vs .tsx =>JSX
- Final Project npx react-native init finalProject Clear App.tsx (with tsrnfs)
-
Folder Structure [https://medium.com/@fdikmen/react-native-%C3%B6rnek-klas%C3%B6r-yap%C4%B1s%C4%B1-fbc1e131f813]
-
npm install @react-navigation/native
-
npm install react-native-screens react-native-safe-area-context
-
npx pod-install ios => cd ios && pod install
-
Import ( import { NavigationContainer } from '@react-navigation/native';)
-
npm install @react-navigation/native-stack
-
npm install @react-navigation/bottom-tabs
-
npm install @react-navigation/drawer
- npm install react-native-gesture-handler react-native-reanimated
- import 'react-native-gesture-handler';
- npx pod-install ios => cd ios && pod install
-
npm i axios
-
npm install redux
- npm install react-redux
- yarn add @reduxjs/toolkit
- https://medium.com/@fdikmen/redux-toolkit-ile-modern-redux-kullan%C4%B1m%C4%B1-5b59f8055da6
- Nested Navigation
- Cutom Icon on Tab Navigation
- Coding Login Page
- Redux
- File Upload Permissons
- android => .../android/app/src/debug/AndroidManifest.xml
- ios => .../ios/finalProject/Info.plist