React Context Websocket
Answered
Abdi 🦁🔥 posted this in #help-forum
Abdi 🦁🔥OP
I have hit a wall.
I use a .NET backend with SignalR for a Draw & Guess web app. I use Next.JS as frontend.
I have managed to get a connection from my Next.JS to my SignalR hub with multiple clients - and make them sync data. But as soon as i switch pages, the connection closes.
I use React Context to hold the connection, so it should work - i think?
Are there anybody smarter than me, able to tell me if im doing something totally wrong? It's just a WebSocket connection ig, so shouldn't matter if it's SignalR or not.
Repo: https://github.com/WizedWasTaken/DrawAndGuessDotNet/tree/main/source/DrawAndGuess/DrawAndGuess.Client/client
I use a .NET backend with SignalR for a Draw & Guess web app. I use Next.JS as frontend.
I have managed to get a connection from my Next.JS to my SignalR hub with multiple clients - and make them sync data. But as soon as i switch pages, the connection closes.
I use React Context to hold the connection, so it should work - i think?
Are there anybody smarter than me, able to tell me if im doing something totally wrong? It's just a WebSocket connection ig, so shouldn't matter if it's SignalR or not.
Repo: https://github.com/WizedWasTaken/DrawAndGuessDotNet/tree/main/source/DrawAndGuess/DrawAndGuess.Client/client
Answered by Abdi 🦁🔥
Fixed it 😁
Used anchor links instead of Link.
Made a Blazor Server app before this 😅
Used anchor links instead of Link.
Made a Blazor Server app before this 😅