I need to pass city name in URL. I have declared Variable city and I am passing it in URL but it is not reading variable I have tried many methods but they are not working.
const Weather=({city})=>{
const [weather,setWeather]=useState('')
useEffect(() => {
axios
.get(`http://api.weatherstack.com/current?access_key=58hgf1d8d36bf336f347d6cc9fbc7&query=${city}`)
.then(response => {
setWeather(response.data)
})
}, [])
// ...