Преглед изворни кода

fix: do not reuse state variable directly

JustSong пре 2 година
родитељ
комит
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) {
         setLogs(data);
       } else {
-        let newLogs = logs;
+        let newLogs = [...logs];
         newLogs.push(...data);
         setLogs(newLogs);
       }