Created
February 1, 2021 23:30
-
-
Save caelinsutch/5efd09bfdf8120a0c2a3329d8c4d9ffc to your computer and use it in GitHub Desktop.
Lists
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Don't write lops with the rest of the code | |
const Component = ({title, cards}) => { | |
return <div> | |
<h1>{title}</h1> | |
{ | |
cards.map(({title: cardTitle, subtitle, image}) => ({ | |
<div> | |
<h3>{cardTitle}</h3> | |
<h5>{subtitle}</h5> | |
<img src={image} /> | |
</div> | |
})) | |
} | |
</div> | |
} | |
// Break it up into a separate list component | |
const Component = ({title, cards}) => { | |
return <div> | |
<h1>{title}</h1> | |
<CardsList cards={cards} /> | |
</div> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment