I am trying to learn react and try to make a simple react app. It has some bugs that I could not fixed them like to get the weather dat submit button needs to clicked twice. At least, I was getting the weather when I click twice:) on the local. The main problem start when I upload it netlify for deploying https://myweatherapp12.netlify.app This is the link if you want to check it. When I submit the form, it does not fetch the data from weather API. I add the code that handle the onSubmit. Thanks for help..
function updateInput(event) {
event.preventDefault();
setcity1(city);
setcountry1(country);
const API_KEY = "49354479869ae18d7dfbe48bbd9eced7";
fetch(`http://api.openweathermap.org/data/2.5/weather?q=${city1},$Turkey&appid=${API_KEY}`).then((res) => { if (res.status >= 200 && res.status < 299) { return res.json() } else { sethata(true) }}).then((data) => setweatherResponse(data));
setgoster(true);
console.log(city1);
console.log(country1)