Recently upgraded to the latest version of this package, along side NextJS V13/React V18 etc.
And now getting the following error:
error - ReferenceError: window is not defined
at /private/tmp/react-flickity-component-example/node_modules/react-flickity-component/dist/react-flickity-component.umd.js:2:47057
at /private/tmp/react-flickity-component-example/node_modules/react-flickity-component/dist/react-flickity-component.umd.js:2:47088
at /private/tmp/react-flickity-component-example/node_modules/react-flickity-component/dist/react-flickity-component.umd.js:1:75
at Object.<anonymous> (/private/tmp/react-flickity-component-example/node_modules/react-flickity-component/dist/react-flickity-component.umd.js:1:279)
....
However prior to upgrading to V4 we hadn't had this issue.
I've created a clean instance of the react-flickity-component-example, bringing it up to speed with the latest versions and was able to replicate the issue. See the window-error-demo branch.
Any idea how we can overcome this issue whilst keeping this component in SSR for performance reasons?
Recently upgraded to the latest version of this package, along side NextJS V13/React V18 etc.
And now getting the following error:
I found other issues https://github.com/yaodingyd/react-flickity-component/issues/4#issuecomment-486740187 that attempt to solve this issue using the following:
However prior to upgrading to V4 we hadn't had this issue.
I've created a clean instance of the react-flickity-component-example, bringing it up to speed with the latest versions and was able to replicate the issue. See the window-error-demo branch.
Any idea how we can overcome this issue whilst keeping this component in SSR for performance reasons?