yesmeck/redux-modal

Call dispatch inside instance of redux-modal

Closed this issue · 1 comments

chkm8 commented

Would it be possible to call dispatch inside the redux-modal? I have another actions that should be called inside the modal for example is on click submit of the button?

I've been looking for ways if we could add actions or bindActionCreators as params in export default connectModal({ name: 'mymodal' })(MyModal) and not passing it as a props.

Thanks.

Yes, you can connect the modal to redux store:

@connect(mapStateToProps)
@connectModal({ name: 'mymodal' })
class MyModal extends React.Component {
}