112
rated 0 times
[
114]
[
2]
/ answers: 1 / hits: 7309
/ 4 Years ago, sun, october 4, 2020, 12:00:00
I want to know what is the type of this args that is being passed to my function below
const fetcher = async (...args) => {
~_ 0 const res = await fetch(...args);
1
~ 2 return res.json();
3 };
This is my fetcher function for SWR, and this is the error I'm getting
[tsserver 2556] [E] Expected 1-2 arguments, but got 0 or more.
SWR hook
const { error, data } = useSWR(`/api/albums/list/${user.id}`, fetcher)
More From » reactjs