title: React Hook useEffect has missing dependencies: xxx. Either include them or remove the dependency array react-hooks/exhaustive-deps
body: <p>I am making an api call from <code>useEffect</code> hook</p>
  <pre><code>function ChangePassword(props) {
      const token = props.match.params.token;
  
      const [state, setState] = useState({
          password: &quot;&quot;,
          confirmPassword: &quot;&quot;,
      });
      const [status, setStatus] = useState({
          loaded: false,
          auth: false,
      });
  
      useEffect(() =&gt; {
          let { auth } = status;
  
          axios
              .get(
                  `http://localhost:2606/api/hostler/changepassword?token=${token}`
              )
              .then((res) =&gt; {
                  console.log(&quot;res&quot;, res);
                  auth = res.status === 202;
              })
              .then(() =&gt; setStatus({ auth, loaded: true }))
              .catch((err) =&gt; console.log(&quot;err&quot;, err));
      },[]);
  
      return (
          // code
      );
  }
  </code></pre>
  <p>But react gives warning</p>
  <blockquote>
  <p>React Hook useEffect has missing dependencies: 'status' and 'token'. Either include them or remove the dependency array  react-hooks/exhaustive-deps</p>
  </blockquote>
  <p>also adding <code>status</code> to dependency array will result in an infinite loop because <code>setStatus</code> is called inside of useEffect</p>