title: Firebase and React Hooks (useState & useEffect)
body: <p>I have a basic usage of react hooks, but it seems to fail.  </p>
  
  <p>Error</p>
  
  <blockquote>
    <p>Error: Invalid hook call.</p>
  </blockquote>
  
  <p>Code</p>
  
  <pre><code>function GetUserDisplayName(userId) {
    const [displayName, setDisplayName] = useState("Jane Doe");
    db.collection("users")
      .doc(userId)
      .get()
      .then(doc =&gt; {
        setDisplayName(doc.data().displayName);
      });
    return displayName;
  }
  </code></pre>
  
  <p>Note, even without the db call it fails to simply return the default displayName.</p>