react-signalr
react-signalr copied to clipboard
No client method with the name found
Hello -
I'm trying to implement the useSignalREffect
hook of this module and I'm having difficulting getting it to fire. Per the example, I've created a provider and I am successfully using the SignalRContext.invoke()
method to send messages to my server. However, when messages come back, the hook is not firing and I am seeing the warning "No client method with the name "..." found" in the console window.
I have defined both Message callbacks in my hub definition:
const SignalRContext = createSignalRContext<SMS>();
export interface SMS {
callbacksName: SMSEventNames;
callbacks: SMSCallbacks;
/** Invokes hidden **/
}
// Events from Sever to Client
export enum SMSEventNames {
message = 'Message', // Get a message
messageList = 'MessageList', // Get a message list
}
export type SMSCallbacks = {
[SMSEventNames.message]: (value: string) => void;
[SMSEventNames.messageList]: (value: string[]) => void;
};
Is there another step I am missing to wire up the hook? Thanks in advance!