Skip to content

Instantly share code, notes, and snippets.

@kawnayeen
Last active April 2, 2019 17:12
Show Gist options
  • Save kawnayeen/647b1ade014fc065acd7820851839021 to your computer and use it in GitHub Desktop.
Save kawnayeen/647b1ade014fc065acd7820851839021 to your computer and use it in GitHub Desktop.
Enhanced Youtube # 3 - Video List
// step one
const VideoList = (props) => {
const videos = props.videos;
return (
<ul className="col-md-4 list-group">
{videos.length}
</ul>
);
};
// step two
const VideoListItem = (props) => {
return (
<li>Video</li>
);
};
const VideoList = (props) => {
const videos = props.videos;
const videoList = videos.map( v => <VideoListItem video={v} />);
return (
<ul className="col-md-4 list-group">
{videoList}
</ul>
);
};
// step three
const videoList = videos.map( v => <VideoListItem key={v.etag} video={v} />);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment