FredrikOseberg / react-chatbot-kit

MIT License
328 stars 157 forks source link

Error happens while Chatbot component unmounting #82

Open VasilyVP opened 3 years ago

VasilyVP commented 3 years ago

Hello, if I mount and unmount Chatbot on the page then next error happens: TypeError: can't access property "scrollHeight", g.current is null

_C:/SWDevelopment/sites/aixplain/User-Website/nodemodules/react-chatbot-kit/build/index.js:1

seems it use event listeners but they are not cleared while component unmounting

FredrikOseberg commented 3 years ago

Hello, if I mount and unmount Chatbot on the page then next error happens: TypeError: can't access property "scrollHeight", g.current is null

_C:/SWDevelopment/sites/aixplain/User-Website/nodemodules/react-chatbot-kit/build/index.js:1

seems it use event listeners but they are not cleared while component unmounting

@VasilyVP

Strange. I can't reproduce on my end, and this has never before been reported. Which version are you on? If you can provide me with the steps to reproduce then I can look into it. Or you can update to this version and see if the error persists: "react-chatbot-kit": "2.0.0-beta.6"

It's a beta release with typescript conversion and some other improvements. It is mostly backwards compatible, but there is one change done to the css. You now need to include it at the top of the file:

import "react-chatbot-kit/build/main.css";
VasilyVP commented 3 years ago

Hello, I use v1.1.20 and show <Chatbot ... /> by condition. If I hide/unmount the component this type error happens. If show always - it works.

One main condition: it happens in case of Browser developer console is opened and placed bottom