import "@navikt/ds-css"; import { Button, Heading } from "@navikt/ds-react"; import axios , { Axios, AxiosError } from "axios"; import useSWR from "swr"; const fetcher = (url: any) => axios.get(url).then(res => res.data) function fetching() { const {data, error, isLoading} = useSWR('http://0.0.0.0:8080/', fetcher); if (error) return
failed to load: {error.message}
if (isLoading) return
Loading...
return
{data.data}
} export default function Home() { return (
Sprik {fetching()}
) }