From 714190c16142804b1acef4093457e5ace5b3b416 Mon Sep 17 00:00:00 2001 From: Charlie Date: Fri, 3 Nov 2023 10:53:29 +0900 Subject: [PATCH] =?UTF-8?q?#117=20[FE]=20=EC=B1=84=ED=8C=85=20=EA=B4=80?= =?UTF-8?q?=EB=A0=A8=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95=20(#118)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fe/src/routes/js/ChatDetailPage.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fe/src/routes/js/ChatDetailPage.js b/fe/src/routes/js/ChatDetailPage.js index 3475b8b..b867a65 100644 --- a/fe/src/routes/js/ChatDetailPage.js +++ b/fe/src/routes/js/ChatDetailPage.js @@ -37,7 +37,6 @@ function ChatDetailPage() { // api 를 부르는게 아니며, 랜더링될때 실행될 이유가 없어 useCallback을 사용한다. const onMessageReceived = useCallback((data) => { setMessages((prevMessages) => [...prevMessages, data.messages]); - setInputMessage(""); }, []); // STOMP 클라이언트 사용 @@ -96,13 +95,17 @@ function ChatDetailPage() { if (e.key === "Enter" && !e.shiftKey && !isComposing) { e.preventDefault(); sendMessage(inputMessage, memberId); + setInputMessage(""); } }} />