Created
February 22, 2021 15:22
-
-
Save eamonnboyle/a7ecc33731a296cc8eb3dae3bbe8755b to your computer and use it in GitHub Desktop.
Weather App Tutorial - Add a Table
This file contains 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 App() { | |
const [locationSearch, setLocationSearch] = useState('Paris'); | |
const [locations, setLocations] = useState(['Belfast', 'Dublin']); | |
return ( | |
... | |
<table> | |
<thead> | |
<tr> | |
<th>Name</th> | |
</tr> | |
</thead> | |
<tbody> | |
{locations.map(location => | |
<tr><td>{location}</td></tr> | |
)} | |
</tbody> | |
</table> | |
... | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment