Answer the question
In order to leave comments, you need to log in
Why does an error occur when processing an event?
import React from "react";
import Info from "./components/info";
import Form from "./components/Form";
import Weather from "./components/Weather";
const API_KEY = "";
class App extends React.Component {
gettingWeather = async (e) => {
e.preventDefault();
const api_url = await
fetch(`api.openweathermap.org/data/2.5/weather?q=Kiev,ua&appid=${API_KEY}&units=metric`);
const data = await api_url.json();
console.log(data);
}
render(){
return (
<div>
<Info />
<Form weatherMethod={this.gettingWeather} />
<Weather />
</div>
);
}
}
export default App;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question