hosseinmd / react-signalr

MIT License
43 stars 14 forks source link

Nested contexts #20

Closed VladRusanov closed 1 year ago

VladRusanov commented 1 year ago

I have 1 global context for all routes in the application. But I also want to wrap 1 nested component in another context. And when calling the invoke method of the second context, both the nested and the global context are called

VladRusanov commented 1 year ago

image

VladRusanov commented 1 year ago

and i call the invoke method from hub2 in Test2 component. And the .on() method is called in hub2 and in hub1. (Event names are different) and I got an error - HubException: Method does not exist.

VladRusanov commented 1 year ago

Probably I found the solution - I need to use Hub.connection.invoke insted of Hub.invoke, but it is strange