React component to wrap non SSR components.
When working with Server Side Rendering(SSR) enabled apps, you have to deal with client only components. This wrapper makes it simple to work with those components.
npm i --save react-no-ssr
Comments is our client only component. Now we need to render it only on the client. Here’s how we do it.
import React from 'react'; import NoSSR from 'react-no-ssr'; import Comments from './comments.jsx'; const MyPage = () => ( <div> <h2>My Blog Post</h2> <hr /> <NoSSR> <Comments /> </NoSSR> </div> );