Closed Abdqadr1 closed 1 year ago
Hello!
How to send messages is shown here: https://github.com/fallobst22/react-stomp-hooks/blob/master/example/src/App.js#L79
Thanks. But useStompClient hook returns undefined. And in the console, an error that the websocket was closed before the connection was established. What do you think I’m doing wrong?
A lot of things could prevent the connection from establishing correctly. e.g. using the wrong url, a misconfiguration of the backend etc.
I figured it out. I was updating a state on onConnect and onDisconnect props of the StompSessionProvider. Causing re rendering every time.
Send message example should be included in readme. This example is really hard to find especially if you are just looking for stomp library and didn't use it in project yet.
@aalster Thanks for the suggestions. I have added a simple sending Example to the readme.
The example doesn’t show how to send message with the hook.