Jelajahi Sumber

fix: do not reuse state variable directly

JustSong 2 tahun lalu
induk
melakukan
f5c1fcd3c3
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  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);
       }