yaodingyd/react-flickity-component

use asNavFor option for server side rendering

seyyed-sina opened this issue · 1 comments

how can we use external packages like fade and asNavFor?!
I have to slider and want to make asNavFor one for another. how can I achieve this?
I have installed these packages and using nextjs but it gives 'window is not defined'

Annotation 2020-08-03 212914

@spostad7 you can try something like this:

const fade =
  typeof window !== 'undefined' ? require('flickity-fade') : () => null;

... 

{fade && <Flickity />}