Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 23_fetching_data_using_hooks.md #323

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions 23_Fetching_Data_Using_Hooks/23_fetching_data_using_hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div className='country'>
<div className='country_flag'>
<img src={flag} alt={name} />
<img src={flags.png} alt={name.common} />
</div>
<h3 className='country_name'>{name.toUpperCase()}</h3>
<h3 className='country_name'>{name.common.toUpperCase()}</h3>
<div class='country_text'>
<p>
<span>Population: </span>
Expand All @@ -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()
Expand Down