Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Youtube in React: pull in comments for a specific video
import {getCommentsForVideo} from '../../../store/reducers/comments';
class WatchContent extends React.Component {
render() {
{/* ... */}
<Comments comments={this.props.comments} amountComments={112499}/>
{/* ... */
/* ... */
function mapStateToProps(state, props) {
return {
relatedVideos: getRelatedVideos(state, props.videoId),
video: getVideoById(state, props.videoId),
channel: getChannel(state, props.channelId),
comments: getCommentsForVideo(state, props.videoId),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment