react-use-websocket
react-use-websocket copied to clipboard
Addresses #265: fix minor bugs in Example Implementation
Fixes two minor bugs described in #265:
1. messageHistory state instantiation bug
The messageHistory state instantiation updated to:
const [messageHistory, setMessageHistory] = useState<MessageEvent<any>[]>([]);
2. The WebSocketDemo component markup
Made its output look a little more legible. Below is the example output after the fix in a blank app: