import { IonButton, IonCol, IonContent, IonHeader, IonPage, IonRow, IonSearchbar, IonTitle, IonToolbar, } from '@ionic/react'; import { useState } from 'react'; import { CurrentWeather } from '../TestComponents/CurrentWeather'; function Tab2() { const [search, setSearch] = useState(''); const [currentWeather, setCurrentWeather] = useState(false); const performSearch = async () => { getAddress(search); }; const getAddress = async (city) => { const response = await fetch( `https://api.weatherapi.com/v1/current.json?key=f93eb660b2424258bf5155016210712&q=${city}&aqi=no` ); const data = await response.json(); if (data && data.current && data.location) { setCurrentWeather(data); } }; return ( Search Search setSearch(e.target.value)} /> Search
{currentWeather ? ( ) : (

Your search result will appear here

)}
); } export default Tab2;