Jul 30, 2017 · 1 min read
ตรง
The only use case for bindActionCreators is when you want to pass some action creators down to a component that isn't aware of Redux, and you don't want to pass dispatch or the Redux store to it.
ถ้าให้เดาก็ปกติแล้วเวลาจะให้ component ลูก (ที่ไม่ได้ connect กับ redux) ยิง action ได้ เราต้อง pass dispatch ลงไปให้ลูกใช้ยิง ถ้า bindActionCreators เราจะได้ object ที่พร้อมยิงเลย ส่งไปให้ลูกได้
(แต่ปกติผมสร้างฟังก์ชั่นยิงไว้ที่แม่ แล้ว pass ฟังชั่นเอาอะ 555)
