react-file-viewer
react-file-viewer copied to clipboard
removed reference to window in getPhotoDriver to allow for SSR
Addresses #91 A small change to the getPhotoDriver method should allow the react components to initially render on a Node server, so this library can be used with NextJS or similar server rendering libraries.
Can someone please merge this. I really need this working with next.js!
Can someone please merge this. I need this working with next.js!
If someone is still struggling with this problem (hello next.js user), you can use this :
import dynamic from 'next/dynamic';
// @ts-ignore
const DynamicFileViewer = dynamic(() => import('react-file-viewer'), {
ssr: false,
});
This will disable ssr for this module