infeng / react-viewer

react image viewer, supports rotation, scale, zoom and so on
https://infeng.github.io/react-viewer
MIT License
734 stars 137 forks source link

Getting reference Error : document is not defined #198

Open rishabh-arch opened 1 year ago

rishabh-arch commented 1 year ago

It works until I reload the page In NextJS

anilpaudel commented 1 year ago

try this

import dynamic from 'next/dynamic' const Viewer = dynamic( () => import('react-viewer'), { ssr: false } )

https://github.com/infeng/react-viewer/issues/104#issuecomment-701316201