From f5c1fcd3c3c9ddfe9fac0ad09b0eb6adfb103244 Mon Sep 17 00:00:00 2001 From: JustSong Date: Sat, 24 Jun 2023 19:45:18 +0800 Subject: [PATCH] fix: do not reuse state variable directly --- web/src/components/LogsTable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/components/LogsTable.js b/web/src/components/LogsTable.js index 9d531133..db275eb8 100644 --- a/web/src/components/LogsTable.js +++ b/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); }