Merge pull request #123 from gromov-io/patch-1

update README
This commit is contained in:
feng zhi hao 2021-03-19 15:15:57 +08:00 committed by GitHub
commit bdd64fbcca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,8 +37,31 @@ function App() {
}
```
## Server Side Rendering
## Server Side (NextJS)
```
import React, { FC } from 'react'
import dynamic from 'next/dynamic'
const ReactViewer = dynamic(
() => import('react-viewer'),
{ ssr: false }
)
export const Viewer: FC = () => {
return (
<ReactViewer
visible={true}
onClose={() => {}}
images={[{src: ''}]}
/>
)
}
export default Viewer
```
## Server Side rest..
I'm sorry, ssr is not currently supported in `3.x`, it will be fixed in `4.0`.
## Props