scrimba
Frontend Career Path
React basics
AirBnb clone
Props part 3: Create a contact component
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

Props part 3: Create a contact component
AboutCommentsNotes
Props part 3: Create a contact component
Expand for more info
App.js
run
preview
console
import React from "react"

/* Challenge:

- Create a Contact.js component in another file
- Move one of the contact card divs below into that file
- import and render 4 instances of that contact card
- Think ahead: what's the problem with doing it this way?
*/

function App() {
return (
<div className="contacts">

<div className="contact-card">
<img src="./images/mr-whiskerson.png"/>
<h3>Mr. Whiskerson</h3>
<div className="info-group">
<img src="./images/phone-icon.png" />
<p>(212) 555-1234</p>
</div>
<div className="info-group">
<img src="./images/mail-icon.png" />
<p>mr.whiskaz@catnap.meow</p>
</div>
</div>

<div className="contact-card">
<img src="./images/fluffykins.png"/>
<h3>Fluffykins</h3>
<div className="info-group">
<img src="./images/phone-icon.png" />
<p>(212) 555-2345</p>
</div>
<div className="info-group">
<img src="./images/mail-icon.png" />
<p>fluff@me.com</p>
</div>
</div>

<div className="contact-card">
<img src="./images/felix.png"/>
<h3>Felix</h3>
<div className="info-group">
<img src="./images/phone-icon.png" />
<p>(212) 555-4567</p>
</div>
<div className="info-group">
<img src="./images/mail-icon.png" />
<p>thecat@hotmail.com</p>
</div>
</div>

<div className="contact-card">
<img src="./images/pumpkin.png"/>
<h3>Pumpkin</h3>
<div className="info-group">
<img src="./images/phone-icon.png" />
<p>(0800) CAT KING</p>
</div>
<div className="info-group">
<img src="./images/mail-icon.png" />
<p>pumpkin@scrimba.com</p>
</div>
</div>

</div>
)
}

export default App
Console
/index.html
-8:28