Skip to content

Instantly share code, notes, and snippets.

@koss-lebedev
Created July 5, 2022 10:44
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 koss-lebedev/f7effe48947651d50079b27686ed9052 to your computer and use it in GitHub Desktop.
Save koss-lebedev/f7effe48947651d50079b27686ed9052 to your computer and use it in GitHub Desktop.
type Video = {
title: string
duration: number
coverUrl: string
}
type Props = {
items: Array<Video>
}
const VideoList = ({ items }) => {
return (
<ul>
{items.map(item =>
<Thumbnail
key={item.title}
video={item}
/>
)}
</ul>
)
}
@dhanushkac
Copy link

dhanushkac commented Jul 12, 2022

I guess this needs Props to be referenced to explain what you wanted here.

type Video = {
  title: string
  duration: number
  coverUrl: string
}

type Props = {
  items: Array<Video>
}

const VideoList = ({ items } : Props) => {
  return (
    <ul>
      {items.map(item => 
        <Thumbnail 
          key={item.title} 
          video={item} 
        />
      )}
    </ul>
  )
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment