Solution
useEffect(() => {
fetch("https://backend.herokuapp.com/test", {
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
},
}).then((response) =>
response.json().then((data) => {
setTest(data.tests);
})
);}, []);
fetch(`${API_URL}/test`, {