Skip to content

Instantly share code, notes, and snippets.

@bobdobbs
Created January 25, 2022 03:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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 : 'bill@microsoft.com' },
{ name : 'Jeff Bezos', email : 'Jeff@amazon.com' },
{name : 'Mark Zuckerberg', email : 'zuck@fb.com'}
]
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