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

Wrong hooks order #9

Open
edoroshenko opened this issue Nov 14, 2016 · 1 comment
Open

Wrong hooks order #9

edoroshenko opened this issue Nov 14, 2016 · 1 comment

Comments

@edoroshenko
Copy link

Let's say, we have two components (c1, c2) to replace with animation from c1 to c2.
Let's say we replace them in out-in mode.

Then their hooks will be invoked in the following order:
componentDidMount c2
componentWillLeave c1
componentDidLeave c1
componentWillEnter c2

I put here only hooks that I use in my app, but it's enough to get the idea.

It can be easily got round by hiding c2 element's node in componentDidMount hook and showing back in componentWillEnter, but it's desirable to be fixed to make the solution solid.

@cheapsteak
Copy link
Owner

Good point, although not sure what the ideal behaviour would be

I unfortunately don't think it'd be possible to actually delay the componentDidMount, since the mounting happens outside TransitionGroupPlus's control

Doing something like adding opacity: 0 to the component seems potentially heavy-handed?
Input welcome

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