Skip to content
Snippets Groups Projects
Commit bd4e2509 authored by ALLEGRE REMI's avatar ALLEGRE REMI
Browse files

Prise en compte des top level domains vides dans CountryDetail

parent 4f5d54b3
Branches main
No related merge requests found
......@@ -69,7 +69,7 @@ const CountryDetail = (props) => {
<div>
<h2>Country detail</h2>
<p>Name: {country.data.name.common}</p>
<p>Top level domain: {country.data.tld[0]}</p>
<p>Top level domain: {country.data.tld && country.data.tld[0]}</p>
<p>Capital city: {country.data.capital[0]}</p>
<p>Population: {country.data.population}</p>
<p>Area: {country.data.area} km²</p>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment