title: React-native await useEffect functions
body: <p>I want to retrieve a field from Firestore but how can I say to wait to do the return until the function into <code>useEffect</code> has been completed?</p>
  <p>This is my code:</p>
  <pre><code>useEffect(() =&gt; {
        handlClick();
    }, []);
  
    const handlClick = async() =&gt; {
      setRestaurant([]);
      db.doc(idBranch).get().then(data =&gt; {
          const branchData = data.data();
          setRestaurant(brn =&gt; [...brn, branchData]);
      })
    }
  
    return (
      &lt;View&gt;
          &lt;Text&gt; Name: {restaurant.Name} &lt;/Text&gt;
      &lt;/View&gt;
    );
  </code></pre>