// Get location manually and fetch weather data getSearchLocation = (value) => { const weatherApiLink = `https://api.openweathermap.org/data/2.5/weather?q=${value}&appid=${apiKeys.weatherKey}&units=metric`; this.setState({ weatherApiLink, value }) console.log(value) console.log(this.state.value) console.log(this.state.weatherApiLink) }getSearchLocation obtiene su valor de otros componentes mediante accesorios y se ejecuta en la función onClick. cuando se ejecuta la función anterior y ejecutamos conslole.log(value) devuelve el valor correcto pero cuando ejecutamos console.log(this.state.value) devuelve UNDEFINED en el primer clic, en el segundo clic el estado es actualizado