Why does `res.text()` not work inside `useEffect()`?
On
The data returns fine in the server's console (the part outside the
then it shows on both sides. Why is that the case?
(Also asked on Stack Overflow).
islands/test.tsx I have:The data returns fine in the server's console (the part outside the
useEffect() hook), but it doesn't show up in the client's console. However if I change the fetch function to:then it shows on both sides. Why is that the case?
(Also asked on Stack Overflow).
Stack Overflow
On islands/test.tsx I have:
import { useEffect } from "preact/hooks";
export default function Test(){
fetch('https://example.com')
.then(res => res.text())
.then(d => c...
import { useEffect } from "preact/hooks";
export default function Test(){
fetch('https://example.com')
.then(res => res.text())
.then(d => c...
