react基礎:什麼是 redux?

這什麼要用 redux?          React 是單向數據流。父傳子通過 props。那麼非父子組件中的通信就可以用 redux 中的 state 解決。   Redux 的原理是什麼?       Redux 中把狀態存到 store 中,組件 dispatch 到 action  (發送行爲)到 store,不是直接通知其他組件,組件通過訂閱的store 中的 state 來更新視圖。
相關文章
相關標籤/搜索