title: How do I check my user is already connected?
body: <p>I made a react hook to return the client for this library, and in this hook, I'm also connecting the user.</p>
  <pre class="lang-js prettyprint-override"><code>useEffect((): any =&gt; {
    async function getSub() {
      const {
        data: { createSupportChatSubscription },
      } = await getSubscription();
      return createSupportChatSubscription.subscription;
    }
  
    getSub().then(async (res: ISubscription) =&gt; {
      const chatClient = StreamChat.getInstance(process.env.REACT_APP_STREAM_ID as string);
  
      await chatClient.connectUser(
        { id: currentUser.id, name: currentUser.name },
        res.token.token
      );
      setChannelResponse({
        channelId: res.channelId,
        channelType: res.channelType,
      });
      setClient(chatClient);
    });
  
    return () =&gt; client?.disconnectUser();
  }, [getSubscription, client, currentUser.id, currentUser.name, userId]);
  </code></pre>
  <p>when using this hook, I tend to get this warning:</p>
  <pre><code>Consecutive calls to connectUser is detected, ideally you should only call this function once in your app.
  </code></pre>
  <p>I'm trying to see if the chat client has anything to check if there's a connection so I don't have to constantly call <code>connectUser</code>.</p>