Created
January 29, 2020 22:25
-
-
Save r1ckhenry/44884dbe01881b3724c1f37527ab91af to your computer and use it in GitHub Desktop.
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
import React from "react"; | |
import Fetcher from "./Fetcher"; | |
const Table = ({ data }) => { | |
return ( | |
<table> | |
<thead> | |
<tr> | |
<th>Name</th> | |
<th>Poulation</th> | |
</tr> | |
</thead> | |
<tbody> | |
{data.map(country => { | |
return ( | |
<tr key={country.name}> | |
<td>{country.name}</td> | |
<td>{country.population}</td> | |
</tr> | |
); | |
})} | |
</tbody> | |
</table> | |
); | |
}; | |
const Languages = () => { | |
return ( | |
<Fetcher url="https://restcountries.eu/rest/v2/lang/en"> | |
<Table /> | |
</Fetcher> | |
); | |
}; | |
export default Languages; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment