Next.js: forcing client side rendering for specific components

Created on 2 Aug 2017  路  7Comments  路  Source: vercel/next.js

Hi,
I have a chart library which doesn't work with server side rendering.
how can I force the components which use this library to render on the client side?

thanks

Most helpful comment

Here's a new link.

Protip: y to link to file at specific revision so links don't break. Thanks for the ex! :-)

All 7 comments

Like this maybe?

@renancouto thanks for answering 馃憣

works great!
Thanks

Always a pleasure @ramigg @timneutkens 馃嵒

Here's a new link.

Protip: y to link to file at specific revision so links don't break. Thanks for the ex! :-)

Is that NoSSR library valid for React 16?

What about this?

const Map = dynamic(() => import('../components/Map.js'), {
  ssr: false,
  loading: () => <p>Loading map</p>
})
Was this page helpful?
0 / 5 - 0 ratings