scrimba
Frontend Career Path
React basics
AirBnb clone
Project: Pass object as props
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: Pass object as props
AboutCommentsNotes
Project: Pass object as props
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() {
const cards = data.map(item => {
return (
<Card
key={item.id}
img={item.coverImg}
rating={item.stats.rating}
reviewCount={item.stats.reviewCount}
location={item.location}
title={item.title}
price={item.price}
openSpots={item.openSpots}
/>
)
})

// <Hero />
return (
<div>
<Navbar />
<section className="cards-list">
{cards}
</section>
</div>
)
}
Console
/index.html
-4:25