Open viraj-glide opened 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
Right, it doesn't work with React 18 but works with previous versions.
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}
/>
import { Widget } from "react-chat-widget"; import "react-chat-widget/lib/styles.css";
export default function App() { return (
); }