Closed devYuraKim closed 3 months ago
This error occurs when the app is loaded for the first time (=when amount input is empty) and when both currencies(base and result) are the same.
useEffect( function () { async function fetchData() { const host = "api.frankfurter.app"; const res = await fetch( `https://${host}/latest?amount=${amount}&from=${from}&to=${to}` ); const data = await res.json(); const rates = data.rates[to]; setResult(rates); console.log(result); } fetchData(); }, [amount, from, to, result] );
same currency https://github.com/hakanensari/frankfurter/issues/51
amount=0 https://github.com/hakanensari/frankfurter/issues/55
This error occurs when the app is loaded for the first time (=when amount input is empty) and when both currencies(base and result) are the same.