Closed pr1ntr closed 5 years ago
Again, please only make changes to src/index.js
. Definitely don't make change to version in package.json. The release of a new version should be handle by repo owner.
Crap sorry, I thought you meant not to mess with lib/*
files . Don't you think having a develop command is helpful for development the module with npm link? I can revert if not.
It can be helpful but let's split different concerns into their own PR.
I still stand by https://github.com/theolampert/react-flickity-component/pull/71#issuecomment-519769612, but I think this solution is much cleaner.
While I don't disagree with #71, practically, I don't believe that metafizzy will change their position anytime soon. In terms of React, server side rendering solutions are becoming much more approachable and popular so why not accommodate react developer using isomorphic or static with literally one line of code? :)
Thank you for your work @pr1ntr !
Leaving a comment here incase anyone is using flickity-fade and wondering why they're still getting the window undefined
error.
You have to use the same fix here - https://github.com/theolampert/react-flickity-component/issues/4#issuecomment-486740187 - i.e
const fade =
typeof window !== "undefined"
? require("flickity-fade")
: () => null
...to fix the issue. Hope this saves someone a couple of hours of digging.
flickity will call window as soon as its imported. In order to use with SSR it must be required on componentDidMount
This fix is confirmed working in Gatsby. This is a new PR in in lieu of #78