import axios from "axios";
import React, { useEffect, useState } from "react";
export default function App() {
const [val, setVal] = useState();
const getAnswer = async () => {
const { data } = await axios("https://yesno.wtf/api");
setVal(data.answer);
};
useEffect(() => {
getAnswer();
}, []);
return <div>{val}</div>;
}