Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double render of component #126

Closed
dfunaki opened this issue Feb 10, 2017 · 3 comments
Closed

Double render of component #126

dfunaki opened this issue Feb 10, 2017 · 3 comments

Comments

@dfunaki
Copy link

dfunaki commented Feb 10, 2017

Hi, I have been trying to figure out why I am getting a double render of my component

<FlipMove enterAnimation="fade" leaveAnimation="fade" typeName="div" >
       <Card
       key={item.id}
         item={item} />
</FlipMove>

If I put a console.log in the render method of my Card component, I find that FlipMove renders the item twice? I am running into an issue where the Card items that are being rendered are getting mixed up with what was rendered previously. Has anyone else run into this issue? Is there a way I can stop this?

@joshwcomeau
Copy link
Owner

Hey @dfunaki,

So, I created a simple demo here that does what you describe: https://jsbin.com/taziyifixe/1/edit?js,console,output

In that case, when the items are shuffled, their render methods are invoked twice. This is because we use a transitionend callback to do some cleanup once the animation is completed.

It shouldn't be causing problems though, unless you're adding and removing items very quickly, which is a known issue.

If you can modify that jsbin to show the problem you're describing, I can see if I can find the problem.

@joshwcomeau
Copy link
Owner

Closing this as I haven't heard back. Feel free to follow up.

@dfunaki
Copy link
Author

dfunaki commented Feb 15, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants