Answers for "how to detect if app is loosing focuse in react native"

0

how to detect if app is loosing focuse in react native

Copyimport { useFocusEffect } from '@react-navigation/native';
function Profile({ userId }) {  const [user, setUser] = React.useState(null);
  useFocusEffect(    React.useCallback(() => {      const unsubscribe = API.subscribe(userId, user => setUser(data));
      return () => unsubscribe();    }, [userId])  );
  return <ProfileContent user={user} />;}
Posted by: Guest on November-14-2020

Code answers related to "how to detect if app is loosing focuse in react native"

Code answers related to "Javascript"

Browse Popular Code Answers by Language