diff --git a/14_Day_Component_Life_Cycles/14_component_life_cycles.md b/14_Day_Component_Life_Cycles/14_component_life_cycles.md index 15679dd..fb00594 100644 --- a/14_Day_Component_Life_Cycles/14_component_life_cycles.md +++ b/14_Day_Component_Life_Cycles/14_component_life_cycles.md @@ -358,11 +358,6 @@ class App extends Component { } renderCountries = () => { return this.state.data.map((country) => { - const languageOrLanguages = - country.languages.length > 1 ? 'Langauges' : 'Language' - const formatLanguages = country.languages - .map(({ name }) => name) - .join(', ') return (
Capital: {country.capital}
-- {languageOrLanguages}: {formatLanguages} -
Population: {country.population}
Capital: {country.capital}
-- {languageOrLanguages}: {formatLanguages} -
Population: {country.population}
{formatedCapital}
-- {formatLanguage}: - {languages.map((language) => language.name).join(', ')} -
Population: - {population.toLocaleString()} -
-- Currency: - {currency} + {population}
{formatedCapital}
-- {formatLanguage}: - {languages.map((language) => language.name).join(', ')} -
Population: - {population.toLocaleString()} + {population}
Currency: @@ -309,17 +291,6 @@ import axios from 'axios' const Country = ({ country: { name, capital, flag, languages, population, currency }, }) => { - const formatedCapital = - capital.length > 0 ? ( - <> - Capital: - {capital} - > - ) : ( - '' - ) - const formatLanguage = languages.length > 1 ? `Languages` : `Language` - console.log(languages) return (
{formatedCapital}
-- {formatLanguage}: - {languages.map((language) => language.name).join(', ')} -
Population: - {population.toLocaleString()} -
-- Currency: - {currency} + {population}
+ >{formatedCapital}
-- {formatLanguage}: - {languages.map((language) => language.name).join(', ')} -
Population: - {population.toLocaleString()} -
-- Currency: - {currency} + {population}
{formattedCapital}
-- {formattedLanguage}: - {languages.map((language) => language.name).join(', ')} -
Population: - {population.toLocaleString()} -
-- Currency: - {currency} + {population}
{formattedCapital}
-- {formattedLanguage}: - {languages.map((language) => language.name).join(', ')} -
Population: - {population.toLocaleString()} -
-- Currency: - {currency}