Tell us which versions you are using:
Add right button to nav bar, click and go to a new scene
I'm trying to add a right button in my navigation bar, but it's just rendering as a text, and i added a log for when the text is pressed but thats not happening
add following code to your COMPONENTNAME
import React from 'react';
import { TouchableOpacity, Text } from 'react-native';
class COMPONENTNAME extends React.Component {
static renderLeftButton = (props) => {
return (
<TouchableOpacity onPress={() => console.log('onLeftPressed')}>
<Text>Left Button</Text>
</TouchableOpacity>
);
}
static renderRightButton = (props) => {
return (
<TouchableOpacity onPress={() => console.log('onRightPressed')}>
<Text>Right Button</Text>
</TouchableOpacity>
);
}
}
Most helpful comment
add following code to your
COMPONENTNAME