Wolox / react-chat-widget

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

Chat window not opening when click on bubble #310

Open viraj-glide opened 2 years ago

viraj-glide commented 2 years ago

import { Widget } from "react-chat-widget"; import "react-chat-widget/lib/styles.css";

export default function App() { return (

<Widget />

); }

movvav commented 2 years ago

Check you react version. It didn't work for me w React 18. After downgrading to React 17, I was able to get it working

MrFarhan commented 2 years ago

Right, it doesn't work with React 18 but works with previous versions.

integratedpartners commented 1 year ago

Is this package still maintained? React 18 version would be very helpful. As a workaround, you can control it manually like this:

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

  const handleToggle = (chatWindowOpen) => {
    setChatWindowOpen(!chatWindowOpen);
  };

  <Widget
  handleNewUserMessage={handleNewUserMessage}
  handleToggle={handleToggle}
/>