Where I've to use setInterval to fetch every second? When i try it i get this error Uncaught SyntaxError: Unexpected identifier
useEffect(() => {
const getHistory = async () => {
const res = await axios.get('/api/payment', {
headers: { Authorization: token },
});
setHistory(res.data);
};
getHistory();
}, [token, delivered]);
Via Active questions tagged javascript - Stack Overflow https://ift.tt/2h9x0vs
Comments
Post a Comment