这是我的api调用--收到的错误是值未定义,可能引用了我的城市和国家变量??帮助?
goGetWeather = async e => {
e.preventDefault()
const city = e.target.elements.city.value
const country = e.target.elements.country.value
const api_call = await fetch(
`http://api.openweathermap.org/data/2.5/weather?
q=${city},${country}&appid=8004ed6a9e53c30dd054d07
9fff7f24e&un
its=metric`
)
const data = await api_call.json()
console.log(data)render() { return (
<Weather
city={this.state.city}
country={this.state.country}
description={this.state.description}
/>
<br />
</div>
)}}导出默认应用
发布于 2020-02-27 12:26:09
现在,我从子组件中的输入中删除了表单控件属性
https://stackoverflow.com/questions/60424095
复制相似问题