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
export default connect(null, (dispatch, ownProps) => ({ | |
addComment: (comment) => dispatch(addComment(comment, ownProps.articleId)) | |
}))(CommentForm) |
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
export function addComment(comment, articleId) { | |
return { | |
type: ADD_COMMENT, | |
payload: { comment, articleId }, | |
generateId: true | |
} | |
} |
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
render() { | |
return ( | |
<div ref={this.setContainerRef}> | |
Hello world! | |
</div> | |
) | |
} | |
setContainerRef = ref => { | |
this.container = ref; |
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
render() { | |
return ( | |
<div ref='string'> | |
Hello world! | |
</div> | |
) | |
} |