Я создаю приложение с реагированием на натив и использую навигацию lib реагироватьПри попытке вызова кнопки на новом экране навигация не реагирует на нажатие. Кто-нибудь знает, что это может быть?
App.js
import Initial from "./app/screens/Initial";
import Login from "./app/screens/Login";
const AppNavigator = createStackNavigator(
{
Initial:{
screen: Initial
},
Login:{
screen: Login
}
},
{
initialRouteName: 'Initial',
headerMode: 'none',
}
);
export default createAppContainer(AppNavigator);
Initial.js (Мой экран)
Это экран, на котором я отображаю кнопку и вызываю событие щелчка, чтобы реагировать с реакцией реагирования
import React, { Component } from "react";
import { View, StyleSheet, Text, ImageBackground } from "react-native";
import Button from "../components/Form/Button";
import imageLogo from "../assets/images/background2.jpg";
import colors from "../config/color";
class Initial extends Component {
render(){
const { navigate } = this.props.navigation;
return (
<View style={styles.wrapper}>
<ImageBackground source={imageLogo} style={styles.image}>
<Text style={styles.appName}>Hello</Text>
<View style={styles.areaMarketing}>
<Text style={styles.textAds}>text text text </Text>
<Text style={styles.textAds}>good good good.</Text>
</View>
<View style={styles.form}>
<Button onPress={() => this.props.navigation.navigate('Login')}
buttonBackColor={colors.emerald}
buttonBorderColor={colors.emerald}
color={colors.white} labelButton="Entrar"/>
<Button labelButton="Criar conta"/>
</View>
</ImageBackground>
</View>
);
}
}
const styles = StyleSheet.create({
wrapper: {
flex: 1,
justifyContent: "space-between"
},
form: {
flex: 1,
justifyContent: "flex-end"
},
appName: {
margin: 20,
fontSize: 25,
fontFamily: "Nunito-Bold",
color: colors.white
},
areaMarketing: {
marginLeft: 20
},
textAds: {
color: colors.white,
fontSize: 23,
fontFamily: "Nunito-Regular"
},
image: {
width: "100%",
height: "100%"
}
});
export default Initial;
package.json
"dependencies": {
"react": "16.8.6",
"react-native": "0.60.4",
"react-native-gesture-handler": "^1.3.0",
"react-navigation": "^3.11.1",
"react-navigation-stack": "^1.9.4"