devrnt / react-use-intercom

☎️ React Intercom integration without the hassle, powered by hooks.
https://devrnt.github.io/react-use-intercom/#/useIntercom
MIT License
333 stars 43 forks source link

using useIntercom hook makes every event perform a rerender #667

Closed fakhribenfraj closed 7 months ago

fakhribenfraj commented 7 months ago

Describe the bug when i use the hook (boot or update), if we click on the chat button, the app performs a rerender, when i close the chat, it performs a rerender

To Reproduce just call useIntercom hook then open and close the chat

Expected behavior opening and closing the chat shoudn't perform a rereder since i am only calling the boot function

Additional context i am using react 17.0.2

devrnt commented 7 months ago

Thanks for creating this issue.

This is expected behaviour since v2.1.0. In this version the isOpen flag was introduced which returns the visibility status of the messenger

ralphholzmann commented 2 months ago

@fakhribenfraj I'm running into this same issue right now -- were you able to get around it somehow? We have a bunch of user state that is getting reset the instant they open intercom.