title: Making a async function inside useEffect, and use await inside the while loop in the function, seems doesn't work
body: <p>Did anyone meet some questions like me? I make an async function inside useEffect,  and call it. In the async function, I have a while loop, and use await inside the while loop, but it seems like doesn't work, console.log(productsList.length) will print 0, and when I try to use productsList.map to return some components, also return nothing</p>
  <pre><code>useEffect(() =&gt; {
          async function callProduct(){
              let a=5
              while (a&gt;0) {
                  const item = await contract.getProduct(a)
                  await setProductsList([...productsList,item]])
                 a--
              }
          }
          callProduct()
          console.log(productsList.length)
      },[])
  </code></pre>