How to handle updates through websocket?
I'm trying to create a chat and made the following mutation hook to be called on incoming websocket messages:
In my component I use it like this:
However, initially the queryCache is undefined, until I do a Javascript hot reload. What would be a better approach?
I tried moving the useEffect into my hook and use
queryclient as a dependency but it does not make a difference.1 Reply
flat-fuchsiaOP•3y ago
Update: I got it working by doing this:
Still wondering if there is a better way