From 3d1a7fc3d7a563339c78c74f14ab414147ee5de0 Mon Sep 17 00:00:00 2001 From: Gromov Sergey <46241127+gromov-io@users.noreply.github.com> Date: Wed, 30 Sep 2020 14:01:41 +0300 Subject: [PATCH] update README use NextJS SSR --- README.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 250fd66..6d6ccdc 100644 --- a/README.md +++ b/README.md @@ -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 ( + {}} + 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