Skip to content

Commit 1bcedee

Browse files
author
Vitor Dino
committed
🐛 fix ssr build
🤦 obviously document is not defined on node
1 parent 23a4e0c commit 1bcedee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/Image/Progressive.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const getPlaceholderSrc = ({src}) => {
2626
const Progressive = ({src, style = {}}) => {
2727
const targetRef = useRef(null);
2828
const [hasIntersected, setIntersected] = useState(false)
29-
const isIntersecting = useIntersectionObserver(targetRef, document.body)
29+
const isIntersecting = useIntersectionObserver(targetRef, document && document.body)
3030

3131
useEffect(() => (
3232
isIntersecting && !hasIntersected && setIntersected(true)

0 commit comments

Comments
 (0)