在後續的重新render, useState 回傳的第一個值必定會是最後更新的state。 ... 如果你傳入了一個空的array( [] ),effect 內部的props 和state 就一直擁有其初始值。
確定! 回上一頁