Skip to content
Discussion options

You must be logged in to vote

Hi, @mirror-coder.

I think your question is very important one.

As you know via PSPDFKIT, the configurations were different between ReactJS and Electron.

To resolve this, I am sure the conditional configuration should be implemented.

So, I added the below code for an initialization of the PSPDFKIT.

const isDevMode = process.env.NODE_ENV === 'development';

//...

  useEffect(() => {
    const container = containerRef.current;

    (async function () {
      PSPDFKit.unload(container);

      instance = await PSPDFKit.load({
        container: isDevMode ? container : '#pdf-viewer',
        document: props.document,
        baseUrl: isDevMode
          ? `${window.location.protocol}//${window.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mirror-coder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
help wanted Extra attention is needed question Further information is requested
2 participants