Open ZeemZach opened 3 years ago
Please could you provide an example of your code so that we can investigate further.
@mattmogford-alcumus I'm encountering the same problem, here's a sample code that replicates this problem, the first PDF gets loaded, however the next doesn't even load, it's just stuck in loading state. However if you have a file of different type from the first loaded file, it will get loaded.
import DocViewer, {
DocViewerRenderers,
} from 'react-doc-viewer';
const Demo = () => {
return (
<DocViewer
documents={[{
uri: 'https://<PDFURLHERE>.pdf',
fileType: 'pdf'
}, {
uri: 'https://<PDFURLHERE>.pdf',
fileType: 'pdf'
},
{
uri: 'https://<IMGURLHERE>.png', // this file gets loaded
fileType: 'png'
}
]}
pluginRenderers={DocViewerRenderers}
/>
);
};
Please could you provide an example of your code so that we can investigate further.
@mattmogford-alcumus - I have the same code structure as @jojonarte
@mattmogford I've been investigating, I could get it to work by adding the currentDocument
dependency here
https://github.com/Alcumus/react-doc-viewer/blob/fc604da9fb7de040d8799984797141c2482576ad/src/utils/useDocumentLoader.ts#L91
However it results in an unending amount of re-renders
adding currentFileNo
seems to do the trick
at initial 1st file of documents[] loads but after using doc-nav previous or next button. loader keeps on loading bcoz fetch request is not made to 2nd file