import useSWR from "swr"; const fetcher = (url: string) => fetch(url).then((res) => res.text()); export default function Index() { const { data, error, isLoading } = useSWR("/api/cookies", fetcher); if (error) return
Failed to load
; if (isLoading) return
Loading...
; if (!data) return null; return
{`Cookie from response: "${data}"`}
; }