Passing props to child and parent
This commit is contained in:
parent
fa6e1f3c4c
commit
cbbfc39c4f
2 changed files with 11 additions and 4 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue