Answers for "react-navigation: Detect when screen, tabbar is activated / appear / focus / blur"

0

react-navigation: Detect when screen, tabbar is activated / appear / focus / blur

import { useFocusEffect } from '@react-navigation/native';

function ProfileScreen() {
  useFocusEffect(
    React.useCallback(() => {

      alert('Screen was focused');

      return () => {

        alert('Screen was unfocused');
        // Useful for cleanup functions

      };
    }, [])
  );

  return <View />;
}
Posted by: Guest on April-16-2022

Code answers related to "react-navigation: Detect when screen, tabbar is activated / appear / focus / blur"

Code answers related to "Javascript"

Browse Popular Code Answers by Language