I have this code but it doesn't loop at the map, the response.data returning 250 array objects, the countries state should have 250 data but it only have 1
const [countries,setCountries]=useState([])
const [countryInput,setCountryInput]=useState('')
const [listed,setListed]=useState([])
useEffect(()=>{
console.log('useEffect called')
axios.get('https://restcountries.com/v3.1/all').then(response=>{
console.log(response.data)
response.data.map(item=>setCountries(countries.concat(item.name.common)))
})
},[])