原创 React: setState解析

作用 更新 State 中的數據 因爲 React 不允許直接更改 state 中的數據,所以引入了 setState() 方法。當調用 setState 時,會重新執行 render 函數,進而根據最新的 State 來創建 R