When would bindActionCreators be used in react/redux?

后端 未结 10 1083
温柔的废话
温柔的废话 2020-12-07 11:04

Redux docs for bindActionCreators states that:

The only use case for bindActionCreators is when you want to pass some action cre

10条回答
  •  误落风尘
    2020-12-07 11:39

    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.
    

    this is very helpful if you use typescript with redux.

提交回复
热议问题