robtaussig / react-use-websocket

React Hook for WebSocket communication
MIT License
1.63k stars 135 forks source link

Why do I click connect to websocket but it connect twice? #244

Open phlong86 opened 1 month ago

phlong86 commented 1 month ago
Screen Shot 2024-10-04 at 16 47 31
robtaussig commented 1 month ago

Can you provide a code example/repo link? My best guess is that the hook is being called in two components and you aren't using the share option.

jennydaman commented 1 month ago

It could also be a React.StrictMode gotcha.