(null); + useEffect(() => { - fetch("http://zenquotes.io/api/random", { method: "GET" }) + fetch("https://zenquotes.io/api/random") .then((res) => { console.log(res); + + return res.json(); }) - .catch(() => { + .then((data: any) => { + console.warn(data); + + // setQuote(res[0]); + }) + .catch((error) => { // do nothing, don't bother user, just don't show the quote + console.warn(error); }); }, []); - return <>{}>; + return ( ++ {quote && ( + + {quote.q} + {quote.a} + + )} ++ ); }