在後續的重新render, useState 回傳的第一個值必定會是最後更新的state。 ... 要實現這一點,可以向 useEffect 傳遞第二個參數,它是該effect 所依賴的值array。
確定! 回上一頁