Created
April 30, 2017 10:05
-
-
Save timcase/84a38b3cedf5620be7fb063ece8bd4d9 to your computer and use it in GitHub Desktop.
onSubmit modded to accept state from redux-form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var React = require('react'); | |
var ReactDOM = require('react-dom'); | |
// var $ = require('jquery'); | |
module.exports = { | |
propTypes: { | |
onSubmit: React.PropTypes.func.isRequired | |
}, | |
componentDidMount: function() { | |
this.show(); | |
}, | |
show: function() { | |
var node = ReactDOM.findDOMNode(this); | |
$(node).modal('show'); | |
}, | |
dismiss: function() { | |
var node = ReactDOM.findDOMNode(this); | |
$(node).modal('hide'); | |
}, | |
onSubmit: function(values) { | |
this.dismiss(); | |
this.props.onSubmit(values || {}); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment