Skip to content

Instantly share code, notes, and snippets.

@productioncoder
Last active November 11, 2018 21:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save productioncoder/a277cef4029fa18a807e9576b13ce6a8 to your computer and use it in GitHub Desktop.
Save productioncoder/a277cef4029fa18a807e9576b13ce6a8 to your computer and use it in GitHub Desktop.
Youtube in React: get channel id in Watch
/* ... */
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