Best Practices for managing memory in react

Using PDFJS Webviewer in React, what are some tips/best practices for managing memory when dealing with a single webviewer and multiple pdf documents.

Currently our memory usage grows with each document switch, even if returning to a document that had already been loaded.

Hi there,

We recommend using the loadDocument API to open every new document with the same instance.

Please see this guide for more details:

Best regards,

Kevin