I'm looking for a way to call a function on each screen to track user interaction with each screen. so for example:
function track(screenName){
 console.log(screenName)
}
function ScreenA(){
 track('ScreenA')
 return <View />
}
function ScreenB(){
 track('ScreenB')
 return <View />
}
Instead of having to call the function manually in each screen separately , I believe there has to be a way to do it from the navigator directly. I'm using :
react-navigation 5.9 
react-native 0.65
 
    