From fed64bd6c46bb68ba62d637a71fe647869a02fa6 Mon Sep 17 00:00:00 2001 From: malmen237 Date: Fri, 19 Apr 2024 14:42:32 +0200 Subject: [PATCH] fix: moved set-state out of for-each --- src/components/production-line/production-line.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/production-line/production-line.tsx b/src/components/production-line/production-line.tsx index e55228c2..a15006f9 100644 --- a/src/components/production-line/production-line.tsx +++ b/src/components/production-line/production-line.tsx @@ -111,8 +111,8 @@ export const ProductionLine: FC = () => { audioElements.forEach((singleElement: HTMLAudioElement) => { // eslint-disable-next-line no-param-reassign singleElement.muted = !isOutputMuted; - setIsOutputMuted(!isOutputMuted); }); + setIsOutputMuted(!isOutputMuted); }, [audioElements, isOutputMuted]); const line = useLinePolling({ joinProductionOptions });