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

Page rerender making empty document viewer #222

Open
sridharvemulapalli opened this issue Jan 15, 2024 · 1 comment
Open

Page rerender making empty document viewer #222

sridharvemulapalli opened this issue Jan 15, 2024 · 1 comment

Comments

@sridharvemulapalli
Copy link

sridharvemulapalli commented Jan 15, 2024

The document viewer is a child element of a page, when the page loads initially the document viewer is working perfect. Refer the screen shot #1.

The page state modification will trigger the re render cycle, at this time document viewer is becoming empty refer the screen shot # 2.

Screen shot #1 :
image

Screen Shot #2:

image
    const docs = [
        { uri: require('./lorem-ipsum.pdf'), fileType: 'pdf' },
        { uri: require('./loremipsum.pdf'), fileType: 'pdf' },
    ];
    
     <DocViewer
                 documents={docs}
                 pluginRenderers={DocViewerRenderers}
                config={{ pdfVerticalScrollByDefault: true }}
        />

Question 2: Is there any way setPageNumber directly and how to know the total number of pages.

Please provide some help or comments.

@prajilshrestha
Copy link

Please refer to this, using key should rerender the viewer. #161

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

2 participants