yaodingyd / react-flickity-component

A React.js component for using @desandro's Flickity
314 stars 51 forks source link

Cannot update during an existing state transition #86

Closed mlbonniec closed 4 years ago

mlbonniec commented 4 years ago

Hello, small problem with version 3.4.0 of the package. It doesn't seem to impact the rendering, but the error is still present. I didn't find out where this error came from.


Capture d’écran 2019-11-16 à 14 19 49

bhtru commented 4 years ago

I don't know if it's applicable in your use case but setting the static prop to true removed the error for me. My carousel contents will be static so it's not issue for me if I can't update the contents on the fly.

On the repo homepage it's mentioned that if you need to update your carousel you can use reloadOnUpdate. That workaround could be worth your time if you absolutely need to remove the error and don't mind the cost.

mlbonniec commented 4 years ago

Indeed your solution works, but unfortunately my carousel is dynamic. So I don't know how to fix it.

MantasMikal commented 4 years ago

Any news on this?

yaodingyd commented 4 years ago

91 is aimed to fix this

TrejoCode commented 4 years ago

Thank you @yaodingyd i will stay waiting for this, because i have the same "error".

auspham commented 4 years ago

Using static and/or reloadOnUpdate doesnt work for me. This is how I render it:

 const Posts = edges
        .filter(edge => !!edge.node.frontmatter.date) // You can filter your posts based on some criteria
        .map((edge) => <ShowcaseItem key={edge.node.id} post={edge.node} />)
return  <Flickity options={flickityOptions}>{Posts}</Flickity>
yaodingyd commented 4 years ago

3.5.0 is published with the fix. Did you try it out? @rockmanvnx6

auspham commented 4 years ago

I'm using 3.4.0 due to #96

yaodingyd commented 4 years ago

Use the latest version and install your own flickity.

yaodingyd commented 4 years ago

@rockmanvnx6 is your issue fixed?

auspham commented 4 years ago

@yaodingyd sorry was not receiving any notifications on this topic for some reasons, thanks for reminding, will try it out tonight.