From 3d57d63f7ff1f7034f8795cd649152950df7cb2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Thu, 6 Jul 2023 12:12:28 +0200 Subject: [PATCH] Don't unnecessarily use `useEffect` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/room/GroupCallView.tsx | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/room/GroupCallView.tsx b/src/room/GroupCallView.tsx index 1b23fcf..64c3e96 100644 --- a/src/room/GroupCallView.tsx +++ b/src/room/GroupCallView.tsx @@ -219,14 +219,7 @@ export function GroupCallView({ undefined ); - const [livekitServiceURL, setLivekitServiceURL] = useState< - string | undefined - >(groupCall.foci[0]?.livekitServiceUrl); - - useEffect(() => { - setLivekitServiceURL(groupCall.foci[0]?.livekitServiceUrl); - }, [setLivekitServiceURL, groupCall]); - + const livekitServiceURL = groupCall.foci[0]?.livekitServiceUrl; if (!livekitServiceURL) { return ; }