Add an effect hook to be called from anywhere in a subtree that tracks the active and inactive state of the parent tab context. This is similar to the useStackViewFocusEffect previously implemented.
It will accept a callback that is run when the tab becomes active, and returns another callback to be run when it is "blurred" (becomes inactive)
useTabFocusEffect(() => {
console.log('Tab is active')
return () => {
console.log('Tab is inactive')
}
})
Add an effect hook to be called from anywhere in a subtree that tracks the active and inactive state of the parent tab context. This is similar to the
useStackViewFocusEffectpreviously implemented.It will accept a callback that is run when the tab becomes active, and returns another callback to be run when it is "blurred" (becomes inactive)