From 546031f1502cc6d34d38a5b043280a63acfc25a5 Mon Sep 17 00:00:00 2001 From: Chuan-Heng Hsiao <2970164+chhsiao1981@users.noreply.github.com> Date: Thu, 7 Aug 2025 07:59:18 -0400 Subject: [PATCH] README.md: a typo in "Example Implementation". --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2ab8263..f58e716 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ export const WebSocketDemo = () => { //Public API that will echo messages sent to it back to the client const [socketUrl, setSocketUrl] = useState('wss://echo.websocket.org'); const [messageHistory, setMessageHistory] = - useState < MessageEvent < any > [] > []; + useState < MessageEvent < any > [] > ([]); const { sendMessage, lastMessage, readyState } = useWebSocket(socketUrl); @@ -306,7 +306,7 @@ const [sendMessage, lastMessage, readyState] = useWebSocket( { shouldReconnect: (closeEvent) => { /* - useWebSocket will handle unmounting for you, but this is an example of a + useWebSocket will handle unmounting for you, but this is an example of a case in which you would not want it to automatically reconnect */ return didUnmount.current === false;