SSR TypeError: Cannot read properties of null (reading 'useState')
omar2205 opened this issue · comments
try to execute deno cache -r https://esm.sh/react@18.2.0
It fixed the generated template. Now when I try to add this code it breaks again with
Cannot read properties of null (reading 'useState')
import { useEffect, useState } from "react"
// ...
const [c, setC] = useState(0)
useEffect(() => {
const i = setInterval(() => {
setC(c + 1);
}, 500)
return () => clearInterval(i)
}, [])
please change "react": "https://esm.sh/react@18.2.0"
to "react": "https://esm.sh/v113/react@18.2.0" in your import map and jsxImportSource
in deno.json
mmm, I updated that import but still.
Here is a repo with the problem https://github.com/omar2205/aleph-q-react
Cannot read properties of null (reading 'useState')
where you got the message? is devtools console?
... I had to CTRL+SHIFT+R
🤦