Просмотр исходного кода

fix: do not reuse state variable directly

JustSong 2 лет назад
Родитель
Сommit
f5c1fcd3c3
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      web/src/components/LogsTable.js

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

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