Re Rerendering WebViewer

Which product are you using?
PDF.js Express Plus

PDF.js Express Version
8.4.7

Detailed description of issue
I’m having trouble with maintaing a webViewer amongst conditional components. What is the best strategy for initializing and preserving / reinitiliazing the webViewer.

When the conditional selected document is true for the 2nd time after being false, it does not reload the webviewer in the DOM.

<ParentComponent>
  {selectedDocument && <DocumentComponent/>
<ParentComponent/>


<DocumentComponent>   // Renders full screen
   <DocumentContextProvider>
     <Header/>
       <WebViewerDiv/> // This initializes the webviewer.
     <Footer/>
   <DocumentContextProvider/>
</DocumentComponent>

Hi there,

Re-initializing WebViewer is not recommended. Please see our guide here:

We recommend you to keep the existing instance and use loadDocument to reload documents instead.

Best regards,
Kevin Kim