Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When the Zendesk component unmounts and then remounts, it no longer functions correctly. #45

Open
WilliamPriorielloGarda opened this issue Feb 19, 2024 · 0 comments

Comments

@WilliamPriorielloGarda
Copy link

In componentDidMount(), you insert the Zendesk script which also defines window.zE.

In componentWillUnmount(), you don't remove the previously inserted Zendesk script and you also delete window.zE. Every time the component remounts, it inserts an additional Zendesk script and the old scripts still persist on the page.

In our experience, window.zE also does not work correctly after a remount.

The solution for us was to simply remove componentWillUnmount. We don't see a reason why we should delete window.zE manually whenever the Zendesk component unmounts. We can simply keep using same window.zE throughout the whole session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant