title: Can I call separate function in useEffect?
body: <p>Can I call another separate function in useEffect?</p>
  <p>I am calling another function in useEffect but after saving the file it is automatically adding that function in array parameters of useEffect.</p>
  <p>See the code below for proper understanding.</p>
  <p>Before saving file:</p>
  <pre class="lang-js prettyprint-override"><code>useEffect(() =&gt; {
    getData()
    console.log(&quot;useEffect ran...&quot;);
  }, [query]);
  
  function getData() {
    fetch(`https://jsonplaceholder.typicode.com/${query}`)
    .then(response =&gt; response.json())
    .then(json =&gt; setData(json));
  }
  </code></pre>
  <p>after saving file:</p>
  <pre class="lang-js prettyprint-override"><code>useEffect(() =&gt; {
    getData();
    console.log(&quot;useEffect ran...&quot;);
  }, [getData, query]);
  
  function getData() {
    fetch(`https://jsonplaceholder.typicode.com/${query}`)
      .then(response =&gt; response.json())
      .then(json =&gt; setData(json));
  }
  </code></pre>
  <p>it is running again and again.</p>