Add transition hooks to ReactCSSTransitionGroup.#5915
Add transition hooks to ReactCSSTransitionGroup.#5915RandScullard wants to merge 2 commits intofacebook:masterfrom
Conversation
Please see issue facebook#5914 for details.
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
…g ref to its child.
|
@RandScullard updated the pull request. |
|
I'd love to see this get merged in. |
| CSSCore.removeClass(node, activeClassName); | ||
|
|
||
| if (childRef.componentDidTransition) { | ||
| childRef.componentDidTransition(animationType); |
There was a problem hiding this comment.
Shouldn't coponentWillTransition be called before componentDidTransition?
There was a problem hiding this comment.
It is if I'm not mistaken. This call to componentWillTransition in the the endListener callback, which is called after the transition ends.
There was a problem hiding this comment.
@jmeas That's correct. componentWillTransition is called just before the transition begins and componentDidTransition is called just after it ends. The order looks backwards because of the position of endListener in the source code.
|
@RandScullard I believe this PR will need tests as well. |
|
@aweary I'd love to move this forward, but I could use some guidance on a few things:
|
|
Thank you for the PR! Unfortunately we won’t get it in due to #5914 (comment). Sorry about that! |
| CSSCore.removeClass(node, className); | ||
| CSSCore.removeClass(node, activeClassName); | ||
|
|
||
| if (childRef.componentDidTransition) { |
There was a problem hiding this comment.
I needed to change this to if (childRef && childRef.componentDidTransition) {} to prevent errors in certain situations.
|
For future visitors: this PR works great! It's on my todo list to abstract it into a standalone lib as a maintained version of the CSSTransitionGroup addon. But in the meantime you can reference this PR: https://github.com/jmeas/moolah/pull/405 which shows you what the code should look like. It was a bit tricky since React pulls in deps from this repo (that took me a long time to figure out 😛 ). I also referenced this project for some of the code, although they made a lot of changes to the CSSTransitionGroup itself which I didn't include. |
|
Thanks @jmeas! I'm glad someone was able to make use of this. |
Please see issue #5914 for details.