I am learning react native and I am stack on how to make the app to always start from a specific HomeScreen when app launches or on navigation back. I have a homescreen that populate Flatlist from api calls using a custom hook. And would wish the api call to be always called when app launches. And if response code=-1 to always navigate to another screen called license. When the license screen pops ups and the user uses the arrow back button to navigate back to home screen then app redirect the the initial api call. In short the user should not see the flat list as long as the response code is -1. Here is my code snippet.

const AllClient = () => {
  const navigation = useNavigation();
  const {state} = useAuth();
  let [reload, setReload] = useState(true);

  const [loading, data] = useFetchHook(//this is a custom hook that uses axios private to fetch data from api

  useEffect(() => {

    if (data?.code == -1) {
      navigation.navigate('license');//I want to navigate to License Screen every time user launch the application
    } else {
  }, [loading,data]);

  const [customers, setCustomers] = useState(data?.obj); //to be used in my flatlist
  return (
              keyExtractor={item => item.id.toString()}
              className="flex-1 mb-3"
              renderItem={({item}) =>
                customers.includes(item) ? (
                  <CustomerRow customer={item} />
                ) : null