From 327df3bda233ce41a3d88c7991668681a3b459cf Mon Sep 17 00:00:00 2001 From: Priyanshu Garg Date: Sun, 7 May 2023 17:40:40 +0530 Subject: [PATCH] Update 23_fetching_data_using_hooks.md The Country name and flag are not displayed correctly. so, specify the type of name to display and updated the version of the API link. --- .../23_fetching_data_using_hooks.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/23_Fetching_Data_Using_Hooks/23_fetching_data_using_hooks.md b/23_Fetching_Data_Using_Hooks/23_fetching_data_using_hooks.md index f895e8e..a7c79ba 100644 --- a/23_Fetching_Data_Using_Hooks/23_fetching_data_using_hooks.md +++ b/23_Fetching_Data_Using_Hooks/23_fetching_data_using_hooks.md @@ -36,13 +36,13 @@ import React, { useState, useEffect } from 'react' import axios from 'axios' import ReactDOM, { findDOMNode } from 'react-dom' -const Country = ({ country: { name, flag, population } }) => { +const Country = ({ country: { name, flags, population } }) => { return (
- {name} + {name.common}
-

{name.toUpperCase()}

+

{name.common.toUpperCase()}

Population: @@ -62,7 +62,7 @@ const App = (props) => { }, []) const fetchData = async () => { - const url = 'https://restcountries.eu/rest/v2/all' + const url = 'https://restcountries.com/v3.1/all' try { const response = await fetch(url) const data = await response.json()