mapDispatchToProps定义了 哪些操作要被当成 action 传递个 storeconst mapDispatchToProps = (dispatch, ownProps) => (
{
onClick: () => {
dispatch(setVisibilityFilter(ownProps.filter)) }
}
)
等价于const mapDispatchToProps = {
onClick: (filter) => {
type: 'SET_VISIBILITY_FILTER',
filter: filter
}
}