Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand Down