chat-ui-kit-react
chat-ui-kit-react copied to clipboard
msgRef.current is null but got check undefined in the ContentEditable component causing app crashed
I am facing an error that it'll crash the app entirely. When I traced the error, it shows into this part:
if (typeof msgRef.current === "undefined") {
return true;
}
Based on the error, I think the above line should be checking for null not undefined right. Someone please help, thanks a lot!!
Originally posted by @tunglamforwork in https://github.com/chatscope/chat-ui-kit-react/discussions/173
@tunglamforwork I think the source of the error lies elsewhere — inputRef might not be what you expect it to be. Could you share how you're defining or assigning inputRef? It would help to see the relevant part of your code.
Also, could you please explain where the following code is from?
if (typeof msgRef.current === "undefined") {
return true;
}