Это мои Booking.js
коды.
import React, { Component } from 'react';
import { StyleSheet, View, ScrollView, Alert, } from 'react-native';
import { Button } from 'react-native-elements';
class Booking extends Component {
static navigationOptions = {
title: 'Booking',
headerTintColor: 'white',
headerBackTitle: 'Back',
headerStyle: { backgroundColor: 'black', },
headerRight: (
<Button
onPress={() => { this.props.navigation.navigate('Bnew') }}
title='New'
color='white'
backgroundColor='black'
/>
),
}
render() {
return (
<View style={styles.container}>
<View style={styles.boohis}>
<Button
onPress={() => { Alert.alert("", "Upcoming is Coming Soon!") }}
title='Upcoming'
color='white'
backgroundColor='black'
style={{ width: 185, margin:1 }}
/>
<Button
onPress={() => { Alert.alert("", "History is Coming Soon!") }}
title='History'
color='white'
backgroundColor='black'
style={{ width: 185, margin:1 }}
/>
</View>
<View style={styles.container2}>
<ScrollView contentContainerStyle={{ justifyContent: 'space-between', padding: 3, alignItems: 'center' }}>
<Button
title='New'
fontWeight='bold'
buttonStyle={{ borderRadius: 15, backgroundColor: '#10a366', height: 50, width: 300, margin: 15 }}
onPress={() => { this.props.navigation.navigate('Bnew') }}
/>
</ScrollView>
</View>
</View>
)
}
}
export default Booking;
Это взгляд моего Booking.js
.
![Booking.js](https://i.stack.imgur.com/pMTu9.png)
Это ошибка, которая проявляется.
![error](https://i.stack.imgur.com/QAHaR.png)
Ошибка вышла, потому что я нажимаю кнопку NEW
на панели навигации
но когда я нажму на зеленую кнопку New
, она перейдет на нужную мне страницу.
В моем рендере навигация работает, но не на панели навигации.
В чем здесь проблема?