import SWR

PHOTO EMBED

Fri Oct 06 2023 08:58:45 GMT+0000 (Coordinated Universal Time)

Saved by @Tphilus #htm

import useSWR from 'swr'
 
const HeroSection = () => {
  const { data, error, isLoading } = useSWR('/api/herosection/123', fetcher)
 
  if (error) return <div>failed to load</div>
  if (isLoading) return <div>loading...</div>
 
  // render data
  return <div>hello {data.name}!</div>
}
content_copyCOPY