hosseinmd / react-signalr

MIT License
43 stars 14 forks source link

Compile with warnings #31

Closed prince272 closed 1 year ago

prince272 commented 1 year ago

https://github.com/websockets/ws/issues/1220

hosseinmd commented 1 year ago

Can you tell me what packages using WS?

prince272 commented 1 year ago

First of all, I'd like to say thanks for responding to me. Back to the problem:

I'm using your awesome react-signalr package with NextJS but there are some few errors I'd try my best to point out to you:

prince272 commented 1 year ago

But everything works fine. I'm only using SignalR with these configurations:

    withCredentials={api.config.withCredentials}
    automaticReconnect={true}
    connectEnabled={true}
    accessTokenFactory={currentUser ? () => currentUser.accessToken : undefined}
    dependencies={[currentUser]} // remove previous connection and create a new connection if changed
    logMessageContent={false}
    url={new URL("/signalr", api.config.baseURL).toString()}
prince272 commented 1 year ago

Can you tell me what packages using WS?

I don't use the WS anywhere, I just use the SignalR feature.

hosseinmd commented 1 year ago

This is because we supported socketio too, you can import just signalR by "react-signalr/signalr"

install latest version and import like this

import { createSignalRContext } from "react-signalr/signalr";
prince272 commented 1 year ago

Thank you so much. This library is amazing.