Youtube in React: video list generating VideoPreview elements
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
getVideoPreviews() { | |
if(!this.props.videos || !this.props.videos.length) { | |
return null; | |
} | |
const firstVideo = this.props.videos[0]; | |
if (!firstVideo.snippet.description) {return null} | |
return this.props.videos.map(video => ( | |
<VideoPreview horizontal={true} expanded={true} video={video} key={video.id} pathname={'/watch'} | |
search={'?v=' + video.id}/>) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment