Completed 2.12

This commit is contained in:
2021-09-01 17:45:57 +07:00
parent 614874ddd7
commit 50c2746682
5 changed files with 44 additions and 110 deletions
+2 -8
View File
@@ -1,6 +1,7 @@
import React, { useState, useEffect } from 'react'
import axios from 'axios'
import Filter from './components/Filter'
import Country from './components/Country'
const App = () => {
@@ -16,7 +17,6 @@ const App = () => {
.get('https://restcountries.eu/rest/v2/all')
.then(response => {
setCountryList(response.data)
console.log(CountryList)
})
}, [])
@@ -27,13 +27,7 @@ const App = () => {
<div>
<h2>Country</h2>
<Filter value={newSearch} onChange={handleSearchChange} />
{
filtered.length > 10 ?
'Too many matches, specific another filter' :
filtered.map(item => <p key={item.alpha2Code}>{item.name}</p>)
}
<Country data={filtered} />
</div>
)