score:0

Accepted answer
   useEffect(()=>{
    
    axios.get(`${api.base}weather?lat=${latitude}&lon=${longitude}&units=metric&appid=${api.key}`).then
     ((response) => {
         console.log(response.data)
      })

   },[latitute, longitude])

score:0

useEffect(() => {
  const fetchData = async() => {
    navigator.geolocation.getCurrentPosition((position) => {
        setLatitude(position.coords.latitude)
        setLongitude(position.coords.longitude);

        const response = await axios.get(`${api.base}weatherlat=${position.coords.latitude}&lon=${position.coords.longitude}&units=metric&appid=${api.key}`);
      });
    });
}, []);

Related Query

More Query from same tag