Created
May 10, 2019 04:19
-
-
Save itinsley/9ff0c15779402b722d57e0b45572211f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//container | |
const mapDispatchToProps=(dispatch)=>{ | |
return { | |
createComment: async (trackId, commentText, cb)=>{ | |
dispatch(createCommentAction(trackId, commentText)).then(cb); | |
} | |
} | |
} | |
//Component | |
this.props.createComment(this.props.trackId, this.state.newComment, this.clearFormState); | |
clearFormState(){ | |
this.setState({ | |
newComment: '', | |
loading: false | |
}) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment