Hi I'm using React Navigation with its Material Top Tabs Navigator component Everything works fine except when I enable the swipe option, I can't get a callback method to do more logic. With Material Top Tabs Navigator, users can navigate to different screens from a tabPress or swipe the focusing screen. I need to do more logic by catching that behavior (say changing background color whenever the screen is changed)
With tabPress event (listed from its official doc), it is easy to achieve, but I can't find any event related to the swipe action. I also tried to addListener, no logging while swiping.
componentDidMount() {
this._test= navigation.addListener("focus", () => {
console.log("swiped");
});
}
Any ideas? tks