scrimba
Learn React
AirBnb clone
Project: key prop
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Project: key prop
AboutCommentsNotes
Project: key prop
Expand for more info
App.js
run
preview
console
import React from "react"
import Navbar from "./components/Navbar"
import Hero from "./components/Hero"
import Card from "./components/Card"
import data from "./data"

export default function App() {
// <Hero />
const cards = data.map(item => {
return (
<Card
img={item.coverImg}
rating={item.stats.rating}
reviewCount={item.stats.reviewCount}
location={item.location}
title={item.title}
price={item.price}
/>
)
})

return (
<div>
<Navbar />
{cards}
</div>
)
}
Console
!
"Warning: Each child in a list should have a unique "key" prop. Check the render method of `App`. See https://reactjs.org/link/warning-keys for more information. at Card (exe0.bundle.js:154:29) at App"
,
/index.html
-3:29