So I am trying to fetch an API using NextJS and I am using SWR.
My code is as follows:
import useSWR from "swr";
const fetcher = (url: string) => fetch(url).then((res) => res.json());
export default function Home(){
const { data, error, isLoading } = useSWR(
"https://api.github.com/repos/vercel/swr",
fetcher
);
return <></>
}
When saving the file I get the following message: