Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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