-1

I use Socket IO with RTK Query and Redux-Toolkit, I have a problem when add Socket like a arg to endpoints RTK-QUERY. How can I fix it? enter image description here

enter image description here How can I fix this problem?

1 Answers1

0

Query arguments are meant to be really just "data describing the query" - you should usually not pass something like a websocket connection down there. The general recommendation would be to create that outside of a component and just import it into your query instead of using it as an argument.

phry
  • 35,762
  • 5
  • 67
  • 81