const actions = {
test: () => 1, // Obviously not an action creator
}
const mapStateToProps = (state: RootState) => state
// No Errors
const mapDispatchToProps = (dispatch: Dispatch<RootAction>) => bindActionCreators(actions, dispatch)
const cnRoomWrapper = connect(mapStateToProps, mapDispatchToProps)(RoomWrapper)
However, there is an error if I explicity wrap the dispatch:
// Gives correct error
const mapDispatchToProps = (dispatch: Dispatch<RootAction>) => {
test: () => dispatch(actions.test)
})
How can I validate that the correct actions are being passed to connect?