Skip to content

[Navigator] renderScene onBack not working? #1695

Description

@yamill

Hey, so mistake me if I'm wrong but I'm trying to use the onBack function from the example and it doesn't do anything. I am trying to have a callback that when I swipe back from my video view to my videos view something happens (like navigator.popToTop()).

Can anyone help me understand how I can create a callback properly when the user swipes back to the scene?

Thanks!

renderScene: function(route, navigator){
switch (route.id){
case 'login':
if(Parse.User.current()){
return <Feed/>
}else{
return <Login/>
}
case 'signup':
return <Signup/>;
case 'feed':
return <Feed/>;
case 'video':
return <Video name={route.name} url={route.url} onBack={() => {
console.log('you swiped back!');
}} />;
default:
return <Login/>;
}
},
render: function(){
return (
<Navigator style={{backgroundColor: 'black'}} ref="navigator"
initialRoute={{id: 'login'}}
renderScene={this.renderScene}
/>
)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions