title: cannot set state inside useEffect hook
body: <p>I can see response object containing array of users , but it seems setState doesn't work inside <code>useEffect()</code> hook.</p>
  <p>This is request code.</p>
  <pre><code>     const [users,setUsers] = useState([]);
       const getUsers=async()=&gt;{
           await axios.get(API_URL,{
               headers:{
                   'Content-Type': 'application/json',
                       'Accept': 'application/json',
                       'Access-Control-Allow-Origin': '*'
               }
           })
           .then((res)=&gt;{
              const data = res.data.users;
               console.log(data);
              setUsers([...users,data]);
              console.log(users);
              
           })
           .catch((err)=&gt;{
               console.log(err);
           })
       }
       useEffect(()=&gt;{
           
           getUsers();
       },[])
  </code></pre>