Skip to content

Instantly share code, notes, and snippets.

@productioncoder
Created November 10, 2018 11:33
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/43156c21a318cce5d4d304017fa6304a to your computer and use it in GitHub Desktop.
Save productioncoder/43156c21a318cce5d4d304017fa6304a to your computer and use it in GitHub Desktop.
Youtube in React: Related videos in WatchContent
import {getRelatedVideos, getVideoById} from '../../../store/reducers/videos';
/* ... */
function mapStateToProps(state, props) {
return {
relatedVideos: getRelatedVideos(state, props.videoId),
video: getVideoById(state, props.videoId)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment