The only way my app has to go back from the scene is by the button I created, when I click the back button on my phone the application closes.
Button code I created:
<TouchableHighlight
underlayColor={'#66CDAA'}
onPress={() => {
this.props.navigator.pop();
}}>
<Image source={require('../imgs/Voltar.png')}
</TouchableHighlight>
To navigate between scenes I used import {Navigator} from 'react-native-deprecated-custom-components';
and after importing the scenes I will navigate I used this code:
<Navigator
initialRoute={{id: 'CenaInicial'}}
renderScene={(route, navigator) => {
if(route.id === 'CenaInicial')
{
return(<CenaInicial navigator={navigator} />);
}
So I declared all the scenes and in each of them I put the command this.props.navigator.push({ id: 'NomeDaCena' });
to change the scene. The problem is that only this command is not enough to return the scene with the button of the cell.
What do I have to do for the back button on the phone to make it show the previous scene instead of closing the application?