connectReact Redux 提供了绑定 Reduxstate和dispatchReact 组件的功能(作为属性)。
connect([mapStateToProps], [mapDispatchToProps], [mergeProps], [options])
mapStateToProps(state, [ownProps]): stateProps
mapDispatchToProps(dispatch, [ownProps]): dispatchProps
Run Code Online (Sandbox Code Playgroud)
如何mapStateToProps在函数中访问函数添加的属性mapDispatchToProps?
例如,我使用函数向组件mapStateToProps添加属性,如何访问函数中的属性?propertyFromStatepropertyFromStatemapDispatchToProps
我尝试使用参数ownProps来访问它,但它是undefined.