-
-
Save rbiggs/6620e7ed0cdf14fbef4cf9f0de616324 to your computer and use it in GitHub Desktop.
List functional component
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
| function List({ state, send }) { | |
| return ( | |
| <div class="list-container"> | |
| <p> | |
| <input type="text" /> | |
| <button class="add-item">Add</button> | |
| </p> | |
| <ul class="list"> | |
| { | |
| state.fruits.map(item => <li key={item.key}> | |
| <span>{item.value}</span> | |
| <button class="delete-item">X</button> | |
| </li>) | |
| } | |
| </ul> | |
| </div> | |
| ) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment