SvenKirschbaum / react-stomp-hooks

This repository contain a react library which enables simple access to stomp subscriptions via hooks.
MIT License
63 stars 13 forks source link

Can it use with Next.js (maybe ssr) #3

Closed zeing closed 3 years ago

zeing commented 3 years ago

I try to follow tutorial in example but having error like

image

SvenKirschbaum commented 3 years ago

Hello!

Sorry for this late reply. Were you able to solve your issue in the meantime?

I personally don't have much experience with SSR, but I just tried it in a toy example, and it worked there. Ignoring the SSR aspect, the error looks to me like you don't have a StompSessionProvider as ancestor of a component which uses one of the hooks, however since version 2.0.0 there is a check for this which should give you a more readable Error in this case. Please check if you are using the latest version, or test if the issue still occurs with it.

Otherwise, please provide an example in which the error occurs, so I can test it in more detail. I'm closing this issue, as I'm not sure if it is still relevant after this time, however feel free to reopen if you still need assistance.

Sven