lahsivjar / react-stomp

React websocket component for STOMP protocol over SockJs
https://www.npmjs.com/package/react-stomp
MIT License
134 stars 41 forks source link

Changing topics onmessage fails #150

Closed alarinel closed 3 years ago

alarinel commented 4 years ago

If on the render I change topics then with debug enabled it shows it unsubscribe the old topic and add the new one instead but all subsequent events show up as unhandled. They are handled perfectly fine until the topic changes.

wejrox commented 4 years ago

Seconding this, I'm using this for conditionally rendering based on a setting the user can mutate. The only way around that I've found so far is to have two sockjsclient components be conditionally rendered based on whether the topic has changed, which forces a new component to be created instead of just changing the props.

lahsivjar commented 3 years ago

Fixed by #180