title: axios get request not working inside useEffect
body: <p>I am using axios get request to check if user logged in or not with jwt, However, when app launched it keeps showing the loading state is it set to true in the first time the app launch then it supposes to make get request and validate the user then set loading state to false and navigate to a specific route. what i am getting is loading state is true all time and request not send to backend server.</p>
  <p>here is the function to check if user logged in or not:</p>
  <pre><code> useEffect(() =&gt; {
          
          const checkLoggedIn = async () =&gt; {
              const Token = await AsyncStorage.getItem('Token');
  
              if (Token) {
                  axios.get('http://localhost:3000/isUserAuth', {
                      headers: {
                          'x-access-token': Token
                      }
                  }).then((res) =&gt; {
                   
                      setUser(res.data.user)
                      AsyncStorage.setItem(&quot;Token&quot;, res.token);
                      setIsLoading(false);
  
                  }).catch((error) =&gt; {
                      console.log(error)
                      setIsLoading(false);
                  });
  
              } else {
                  setUser(null);
                  setIsLoading(false)
              }
          }
  
          checkLoggedIn();
  
      }, []);
  </code></pre>
  <p>and this is the backend:</p>
  <pre><code>app.get('/isUserAuth', verifyJWT, (req, res) =&gt; {
    const token = req.headers['x-access-token'];
    let sqlCheck = `SELECT * FROM users where id =?`;
    CON.query(sqlCheck, req.user, (err, user) =&gt; {
  
      if (user) {
        console.log(user)
        return res.status(400).json({ auth: true, user: user, Token: token })
      }
    })
  })
  </code></pre>
  <p>Hope someone help me identifying the problem. thanks</p>