react-chat-widget icon indicating copy to clipboard operation
react-chat-widget copied to clipboard

Widget is not opening when corner button is clicked

Open ifis98 opened this issue 2 years ago • 10 comments

Clicking the widget is not opening the chat. What may be wrong? I used the same format as the documentation to add the widget.

ifis98 avatar Feb 07 '23 22:02 ifis98

I had the same issue. It was probably due to React version being too new, as this package needs ^17.0.2 (currently it is 18). I downgraded React by following this https://stackoverflow.com/a/71908461 and now it seems to work when I click. Not sure exactly why though. Also this seems to be the same issue as #310

nb-programmer avatar Mar 03 '23 15:03 nb-programmer

I had same issue aswell and solution by @nb-programmer solved it.

logone72 avatar May 25 '23 06:05 logone72

But what if we can't downgrade to react 17, what can we do in that case, or is there any other alternative lib for this?

Aiyaz17 avatar Sep 22 '23 14:09 Aiyaz17

you can control it manually like this. It's work for me in React 18.2

  import { React, useEffect, useState } from "react";
  const [chatWindowOpen, setChatWindowOpen] = useState(true);

  const handleToggle = (open) => {
    setChatWindowOpen((prev) => !prev);
  };

  <Widget
    handleToggle={handleToggle}
  />

tinspham209 avatar Oct 05 '23 20:10 tinspham209

Your solution is worked thank you @tinspham209

Janki-T avatar Feb 09 '24 13:02 Janki-T

Thank you so much for your solution @tinspham209 .

HtetWaiYan7191 avatar Feb 14 '24 03:02 HtetWaiYan7191

Is there any other alternative third party library for this. This seems a little bit outdated . Thank you guys .

HtetWaiYan7191 avatar Feb 14 '24 03:02 HtetWaiYan7191

Can I set the chat widget open as the default behaviour? I want it always open.

lexNwimue avatar Apr 16 '24 01:04 lexNwimue

you can control it manually like this. It's work for me in React 18.2

  import { React, useEffect, useState } from "react";
  const [chatWindowOpen, setChatWindowOpen] = useState(true);

  const handleToggle = (open) => {
    setChatWindowOpen((prev) => !prev);
  };

  <Widget
    handleToggle={handleToggle}
  />

Thank you so much <3

kitare17 avatar Apr 29 '24 14:04 kitare17