setStackRoot without animation dosen't work.
Navigation.setStackRoot(this.props.componentId, {
component: {
name: 'mainScreen',
},
options: {
animated: false
}
});
Have also tried
Navigation.setStackRoot(this.props.componentId, {
component: {
name: 'mainScreen',
},
options: {
animation: {
push: { // also tried setStackRoot
enable: false
}
}
}
});
Try this:
Navigation.setStackRoot(this.props.componentId, {
component: {
name: 'mainScreen',
options: {
animations: {
push: { // also tried setStackRoot
enable: false
}
}
}
}
});
@yogevbd I've tried your suggestion but it still doesn't work.
Oh I had a syntax error, changed animation to animations. can you please try again?
That worked! Thank you!
For anyone else for whom the above is not clear...
I was still struggling with disabling what looked like a push animation when calling setStackRoot with the above example. I was able to disable the animation when using the setStackRoot option in animations
Navigation.setStackRoot('Example', {
component: {
name: 'your_screen_name',
options: {
animations: {
setStackRoot: { enabled: false },
},
},
},
})
...as seen here.