From c7b4ba8ca1484a1279739332b4e617858d529dee Mon Sep 17 00:00:00 2001 From: zojgame Date: Fri, 29 Mar 2024 14:43:10 +0500 Subject: [PATCH] fix --- src/components/Reviews.tsx | 46 ++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 12 deletions(-) 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() { ))}

-
+
+ +
+
);