ilk burada 4.x olanı kur.
https://reactnavigation.org/docs/4.x/getting-started
burayı uygula komple.
aşağıdakilerden biri lazım olursa kur
1 |
npm i react-native-navigation |
1 |
npm i react-native-screens |
1 |
npm i react-navigation-stack --save |
1 |
npm i react-navigation-drawer --save |
1 |
npm i react-navigation-tabs |
1 |
npm i react-native-gesture-handler |
1 |
npm install react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-view |
1 |
cd ios; pod install; cd .. |
bende saçma sapan bir hata çıktı kurarken. kendime yine not bırakıyorum siz yapın diye değil bu.
ios içinde Podfile dosyası içinde use flipper diye bi yer varsa bunla değiştir.
1 |
use_flipper!({ 'Flipper-Folly' => '2.3.0' }) |
örnek kod:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
import React,{Component} from 'react'; import { SafeAreaView, StyleSheet, ScrollView, View, Text, TextInput, StatusBar, TouchableOpacity } from 'react-native'; import { createAppContainer } from "react-navigation"; import { createStackNavigator } from "react-navigation-stack"; class App extends Component { constructor() { super(); } render(){ return ( <View > <Text>To-Do Application</Text> </View> ) } } const AppNavigator = createStackNavigator({ Home:{ screen:App } }); export default createAppContainer(AppNavigator); |