diff --git a/docs/snippets/hover-video.jsx b/docs/snippets/hover-video.jsx index a52660c91..8cc18a58f 100644 --- a/docs/snippets/hover-video.jsx +++ b/docs/snippets/hover-video.jsx @@ -1,10 +1,11 @@ -export const HoverVideo = ({ src, poster, className }) => { +export const HoverVideo = ({ src, poster, className, hasAudio = true }) => { const videoRef = useRef(null); + const wrapRef = useRef(null); const [muted, setMuted] = useState(true); + const [inView, setInView] = useState(false); - // Lazy initializer, not a post-mount effect: with useState(false) the first - // committed render would emit `