react-use-websocket icon indicating copy to clipboard operation
react-use-websocket copied to clipboard

Addresses #265: fix minor bugs in Example Implementation

Open darkhaniop opened this issue 10 months ago • 0 comments

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:

react-use-websocket-example-ui-issue-fix

darkhaniop avatar Mar 27 '25 06:03 darkhaniop