# Unmount Zoom lib in React after leaving page

**URL:** <https://devforum.zoom.us/t/unmount-zoom-lib-in-react-after-leaving-page/54853>\
**Category:** Web\
**Created:** [July 28, 2021, 10:25am UTC](https://devforum.zoom.us/t/unmount-zoom-lib-in-react-after-leaving-page/54853 "2021-07-28T10:25:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ioanav](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ioanav/32/29546_2.png) [@ioanav](https://devforum.zoom.us/u/ioanav)\
**Post date:** [July 28, 2021, 10:25am UTC](https://devforum.zoom.us/t/unmount-zoom-lib-in-react-after-leaving-page/54853/1 "2021-07-28T10:25:54Z")

</div>

**Description**  
Could not find a way to unload the Zoom library when the user navigates away from the page

**Error**  
We have the following use case: our app uses the Zoom WebSDK to allow users to join meetings. Whenever a user joins a meeting, the zoom lib is loaded and a lot of elements are added to the DOM.  
If the user presses the leave button, everything works perfectly, however, there are some use cases (e.g using the browser back functionality) when the lib won’t unmount.  
This also happens in Preview mode, if the user presses the back button, the preview won’t disappear.

Is it possible to hide/disable/unmount the web SDK script if the user presses the back button?

**Which Web Client SDK version?**  
Web Client SDK 1.9.7

---

<div class="post-metadata">

**Author:** ![MaxM](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/maxm/32/42303_2.png) [@MaxM](https://devforum.zoom.us/u/MaxM)\
**Post date:** [July 29, 2021, 10:26pm UTC](https://devforum.zoom.us/t/unmount-zoom-lib-in-react-after-leaving-page/54853/2 "2021-07-29T22:26:32Z")

</div>

Hey @ioanav,

Thank you for reaching out to the Zoom Developer Forum. We don’t have a function to unload the SDK from the DOM but I think that might be useful in this case.

Just to be clear, are you seeing this behavior when testing with the [Sample Web App](https://github.com/zoom/sample-app-web) or only with your app?

Thanks,  
Max

---

<div class="post-metadata">

**Author:** ![ioanav](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ioanav/32/29546_2.png) [@ioanav](https://devforum.zoom.us/u/ioanav)\
**Post date:** [July 30, 2021, 8:49am UTC](https://devforum.zoom.us/t/unmount-zoom-lib-in-react-after-leaving-page/54853/3 "2021-07-30T08:49:01Z")

</div>

Hi @MaxM

The sample web app disables the back button functionality, so there is no way to test this.

Thank you,  
Ioana

---

<div class="post-metadata">

**Author:** ![MaxM](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/maxm/32/42303_2.png) [@MaxM](https://devforum.zoom.us/u/MaxM)\
**Post date:** [August 3, 2021, 5:53am UTC](https://devforum.zoom.us/t/unmount-zoom-lib-in-react-after-leaving-page/54853/4 "2021-08-03T05:53:29Z")

</div>

Hey @ioanav,

My apologies, I meant to link the [Sample React App](https://github.com/zoom/websdk-sample-react/tree/master/src).

I think the best route from here is to submit a [#feature-request](https://devforum.zoom.us/c/feature-requests/23) so that our engineering team can consider the feature to cleanly unload from the DOM in a future release.

Thanks,  
Max

---

<div class="post-metadata">

**Author:** ![ioanav](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ioanav/32/29546_2.png) [@ioanav](https://devforum.zoom.us/u/ioanav)\
**Post date:** [August 3, 2021, 9:00am UTC](https://devforum.zoom.us/t/unmount-zoom-lib-in-react-after-leaving-page/54853/5 "2021-08-03T09:00:00Z")

</div>

Hi @MaxM We also tried the Sample React App, same result. Back is disabled there, too.

Kind regards,  
Ioana

---

<div class="post-metadata">

**Author:** ![MaxM](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/maxm/32/42303_2.png) [@MaxM](https://devforum.zoom.us/u/MaxM)\
**Post date:** [August 5, 2021, 1:35am UTC](https://devforum.zoom.us/t/unmount-zoom-lib-in-react-after-leaving-page/54853/6 "2021-08-05T01:35:17Z")

</div>

Hey @ioanav,

Thanks for confirming. If you are using React, you should be able to use a JS router on the client to set the Meeting on a separate route. In this fashion, the browser should store the history by default.

Here’s an example of a client side router that you could use:

> **[React Router: Declarative Routing for React](https://reactrouter.com/)**
>
> Learn once, Route Anywhere

Let me know if that would work for you.

Thanks,  
Max

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [September 4, 2021, 11:35am UTC](https://devforum.zoom.us/t/unmount-zoom-lib-in-react-after-leaving-page/54853/7 "2021-09-04T11:35:22Z")

</div>

Closed on September 4, 2021, 11:35am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
