React Hooks之useReducer

useReducer :接受類型爲 (state, action) => newState 的reducer,並返回與 dispatch 方法配對的當前狀態。(若是你熟悉Redux,你已經知道它是如何工做的。)react 下面定義兩個計數器Counter組件 和 CounterTest組件,使用 useReducer 使它們共享一個count state,當一個組件的 count state發生變
相關文章
相關標籤/搜索