Passing props to child and parent

This commit is contained in:
Rodrigo Pedroso 2019-06-24 00:19:11 -04:00
commit cbbfc39c4f
2 changed files with 11 additions and 4 deletions

View file

@ -1,12 +1,14 @@
import React from 'react'
export default function Team({ teams }) {
export default function Team({ teams, select }) {
return (
<div className='teams'>
<ul className='list'>
{teams.map(team => (
<li className = 'list-item' key={team.id}>
{ team.name }
<button onClick={() => select(team.name)}>
{ team.name }
</button>
</li>
))}
</ul>