Open ifis98 opened 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
I had same issue aswell and solution by @nb-programmer solved it.
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?
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}
/>
Your solution is worked thank you @tinspham209
Thank you so much for your solution @tinspham209 .
Is there any other alternative third party library for this. This seems a little bit outdated . Thank you guys .
Can I set the chat widget open as the default behaviour? I want it always open.
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
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
Clicking the widget is not opening the chat. What may be wrong? I used the same format as the documentation to add the widget.