On certain cases with SSR'd pages (i.e. Next.js), if we have some hydration issues, the Flickity component may first (or intermediately) render null, while still calling componentDidMount and componentDidUpdate.
Without a valid node, the app crashes trying to instantiate Flickity on null:
This patch fixes that, by ensuring that this.carousel exists before trying to instantiate Flickity with it, ensuring that this.flkty exists before trying to access it.
On certain cases with SSR'd pages (i.e. Next.js), if we have some hydration issues, the Flickity component may first (or intermediately) render null, while still calling
componentDidMount
andcomponentDidUpdate
.Without a valid node, the app crashes trying to instantiate Flickity on null:
This patch fixes that, by ensuring that
this.carousel
exists before trying to instantiate Flickity with it, ensuring thatthis.flkty
exists before trying to access it.