function Product() { const callAPI = async () => { try { const res = await fetch(`https://localhost:44376/weatherforecast`); const data = await res.json(); console.log(data); } catch (err) { console.log(err); } } return ( <div> <main > <button onClick={callAPI}>Make API call</button> </main> </div> ) } export default Product
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)