1//Solved : useEffect not called in React Native when back to screen
2import React, { useEffect } from "react";
3import { useIsFocused } from "@react-navigation/native";
4
5const ExampleScreen = (props) => {
6 const isFocused = useIsFocused();
7
8 useEffect(() => {
9 console.log("called");
10 getInitialData();
11 }, [props, isFocused]);
12
13 const getInitialData = async () => {}
14
15 return (
16 ......
17 ......
18 )
19}
20