islands/test.tsx
import { useEffect } from "preact/hooks"; export default function Test(){ fetch('https://example.com') .then(res => res.text()) .then(d => console.log(d)) useEffect(() => { fetch('https://example.com') .then(res => res.text()) .then(d => console.log(d)) }) return 'hi' }
useEffect()
fetch
fetch("https://jsonplaceholder.typicode.com/todos/1") .then(res => res.json()) .then(d => console.log(d))