Explorar o código

优化 showMessage

yourname hai 7 meses
pai
achega
3ff82e56b9
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      client/mobile/pages_classroom.tsx

+ 1 - 1
client/mobile/pages_classroom.tsx

@@ -176,7 +176,7 @@ export const ClassroomPage = () => {
 
   // 消息管理模块
   const showMessage = (text: string): void => {
-    setMessageList([...messageList, text]);
+    setMessageList((prevMessageList) => [...prevMessageList, text])
   };
 
   const listenImEvents = (): void => {