title: calling useFetch hook inside useEffect
body: <p>I found a very <a href="https://www.digitalocean.com/community/tutorials/creating-a-custom-usefetch-react-hook" rel="nofollow noreferrer">interesting hook</a> and I want to use this hook inside a useEffect (it goes against the rules)</p>
  <pre><code>const useFetch = (url, options) =&gt; {
    const [response, setResponse] = React.useState(null);
    const [error, setError] = React.useState(null);
    React.useEffect(() =&gt; {
      const fetchData = async () =&gt; {
        try {
          const res = await fetch(url, options);
          const json = await res.json();
          setResponse(json);
        } catch (error) {
          setError(error);
        }
      };
      fetchData();
    }, []);
    return { response, error };
  };
  
  </code></pre>
  <pre><code>function App() {
    const res = useFetch(&quot;example.com&quot;, {});
  
     useEffect(() =&gt; {
         // use the hook and make a secondary request 
     }, [])
  </code></pre>
  <p>what modifications do I need to make in order to support this? AFAIK hooks can´t be called inside useEffect</p>
  <p>maybe a new parameter that will setUrl and run it again?</p>