Skip to content

Instantly share code, notes, and snippets.

@bobdobbs
Created January 25, 2022 03:34
Show Gist options
  • Save bobdobbs/ee2bcfeece9d85bcbdaafcf3c229a134 to your computer and use it in GitHub Desktop.
Save bobdobbs/ee2bcfeece9d85bcbdaafcf3c229a134 to your computer and use it in GitHub Desktop.
passing in props to function components within .map
let billionaires = [
{ name : 'Bill Gates', email : '[email protected]' },
{ name : 'Jeff Bezos', email : '[email protected]' },
{name : 'Mark Zuckerberg', email : '[email protected]'}
]
function List(i) {
return(
<ul>
{
billionaires.map(
(i) => (
<li>
{i.name}
</li>
)
) // ends map
}
</ul>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment