title: React Hooks Async Best Practice
body: <p>Now with use <code>useEffect</code>s, there is a substitute for <code>componentDidMount</code> into a React Component with Hooks.</p>
  
  <p>Scenario "initial unique call to a server":</p>
  
  <p>To accomplish this, DependencyList (second argument of <code>useEffect</code>) in <code>useEffect</code> should every time an empty array otherwise the application will send every state change a fetch call to the server.</p>
  
  <p>it means, this is the best practice to getData</p>
  
  <pre><code>useEffect(() =&gt; {
    console.log("useEffect, fetchData here");
  }, []);
  </code></pre>
  
  <p>Is it best practice, to use <code>[]</code> as DependencyList param to disable server requesting every state changing?</p>
  
  <p>Link to github
  <a href="https://github.com/facebook/react/issues/14326" rel="noreferrer">https://github.com/facebook/react/issues/14326</a></p>