Closed yaodingyd closed 4 years ago
I have a demobox: https://codesandbox.io/s/react-flickity-w85iq
notice this must work with dynamically adding slides
also remove lockfile because of https://snyk.io/blog/why-npm-lockfiles-can-be-a-security-blindspot-for-injecting-malicious-modules/ and https://github.com/sindresorhus/ama/issues/479#issuecomment-310661514
the fact that the version on lockfile is still 3.3.2 and no one noticed kind of proves the point.
@yaodingyd LGTM
The warning message is because we do another
setState
inrenderPortal
method. This state change is necessary, explained in #80, but to fix this we move setting state intogetDerivedStateFromProps
which is the perfect usage case.In order to use this lifecycle we also need to bump the peer dependency to 16.3.0 which introduced this method. Also move flickity to peer dependency as it makes more sense to let user manage the version of flickity.