diff --git a/src/components/Reviews.tsx b/src/components/Reviews.tsx index ff340fe..68b4c22 100644 --- a/src/components/Reviews.tsx +++ b/src/components/Reviews.tsx @@ -260,11 +260,12 @@ function Reviews() { }); useEffect(() => { - if (videoRefs[0].current) { - const width = videoRefs[0].current.clientWidth; - setVideoWidth(width); - } - }, [videoRefs]); + // console.log("first", videoRefs[0].current?.src); + if (!videoRefs[0].current?.src) return; + console.log("videoRefs[0].current?.src", videoRefs[0].current?.src); + const width = videoRefs[0].current.clientWidth; + setVideoWidth(width); + }, [videoRefs[0]]); function prev() { if (selectedVideoIndex === 0) return; @@ -285,11 +286,11 @@ function Reviews() { return (
Отзывы
@@ -321,7 +322,7 @@ function Reviews() { ))}