Skip to content

Instantly share code, notes, and snippets.

@eamonnboyle
Created February 22, 2021 15:22
Show Gist options
  • Save eamonnboyle/a7ecc33731a296cc8eb3dae3bbe8755b to your computer and use it in GitHub Desktop.
Save eamonnboyle/a7ecc33731a296cc8eb3dae3bbe8755b to your computer and use it in GitHub Desktop.
Weather App Tutorial - Add a Table
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