Is there any limitations to adding SignalR to a component based framework like React?

Viewed 39

I have refactored our previous implementation which used $.connection to now use $.hubConnection and now I want to finish this refactor/clean up by shifting signalR code into hooks/components to make it more cleaner and easier to use in our newer patterns.

I have some questions when it comes to best practices with using SignalR in React:

  • Are there any repercussions for having any component to establish a new connection?
  • Is there a limit for how many connections can be opened?

My original approach was to have some main components establish the container/hubs/callbacks and then pass that down to it's children components via props/context. This way we limited the amount of connections being made and prevent any potential future issues. However this moves away from the design pattern of a component handling it's own responsibility, where in theory if it wants to connect to signalR then it handles it on it's own.

0 Answers
Related