Last active
November 11, 2018 21:45
-
-
Save productioncoder/a277cef4029fa18a807e9576b13ce6a8 to your computer and use it in GitHub Desktop.
Youtube in React: get channel id in Watch
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 class Watch extends React.Component { | |
/* ... */ | |
render() { | |
const videoId = this.getVideoId(); | |
return ( | |
<WatchContent videoId={videoId} channelId={this.props.channelId}/> | |
); | |
} | |
/* ... */ | |
} | |
function mapStateToProps(state, props) { | |
return { | |
youtubeLibraryLoaded: getYoutubeLibraryLoaded(state), | |
channelId: getChannelId(state, props.location, 'v') | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment