Przeglądaj źródła

fix: do not reuse state variable directly

JustSong 2 lat temu
rodzic
commit
f5c1fcd3c3
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      web/src/components/LogsTable.js

+ 1 - 1
web/src/components/LogsTable.js

@@ -107,7 +107,7 @@ const LogsTable = () => {
       if (startIdx === 0) {
         setLogs(data);
       } else {
-        let newLogs = logs;
+        let newLogs = [...logs];
         newLogs.push(...data);
         setLogs(newLogs);
       }