Wolox / react-chat-widget

Awesome chat widget for your React App
MIT License
1.47k stars 457 forks source link

Widget is not opening when corner button is clicked #316

Open ifis98 opened 1 year ago

ifis98 commented 1 year ago

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

nb-programmer commented 1 year ago

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

logone72 commented 1 year ago

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

Aiyaz17 commented 1 year ago

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?

tinspham209 commented 1 year ago

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}
  />
Janki-T commented 9 months ago

Your solution is worked thank you @tinspham209

HtetWaiYan7191 commented 9 months ago

Thank you so much for your solution @tinspham209 .

HtetWaiYan7191 commented 9 months ago

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

lexNwimue commented 7 months ago

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

kitare17 commented 6 months ago

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

mrwilbroad commented 5 months ago

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}
  />

this solution help me , great