redux 使用 bindActionCreators 使子组件不与 redux 结合的情况去获取 action creator 并使用
当子组件不使用 react-redux connect 包裹,触发redux 中的 action 时,使用 bindActionCreators 方法,第一个参数是 action creator ,第二个是从 props 获取的 dispatch ,返回值为 每个被 dispatch 包装过的 action creator ,子组件可直接调用该方法摘抄自官方文档https://www...
原创
2019-08-14 11:04:21 ·
196 阅读 ·
0 评论