Add didLeave method to <TransitionMotion /> - #399
Conversation
2d9a650 to
3b22bca
Compare
3b22bca to
453e6d6
Compare
|
Will do tonight! |
|
Alright, this looks good. Tbh I've forgotten a big chunk of the codebase. Since the tests pass this is non-breaking, I can merge it. But before that, are we sure about the name here? DidLeave vs onRest? |
|
I like So excited for this! This will allow me to do auto height animation in the UI pack 🙌 |
|
|
@DetweilerRyan, that was also what I thought when naming it 'didLeave' :-) @chenglou do you see |
|
I'm aggressively cautious about adding API overhead. TransitionMotion's API has a bit of learning overhead already and I didn't want to add more to it. Lots of people add an animation to their project then move on, so having a stable API throughout time in a (whether I want it or not) flagship react project might be worth more than finding a neater API that breaks dependents every few months. Just doing my part of not adding churn =) Personally, I'm overwhelmed with emails lately so even pings against me might go unnoticed. Trying to catch up though. Also I've been working on some important react-related work lately too (will be open-sourced this week. It's gonna change everything!). But I have to apologize for the codebase quality too. It's not exactly straightforward to navigate it I feel. Feel free to submit more PRs though! And ping me about them! Thanks a lot for this PR. I'll be merging this. Do we want to make a new release? |
|
Yes to a new release please 🙏 thanks for this @hkjorgensen! |
|
@chenglou Thanks for the explanation - I still look forward to that new open source project :-)
Yes, please cut a new version. This expands the API and doesn't break anything :-) |
|
Ok, published as a patch update then! Tell me if anything goes wrong, thanks. |
Had a case where the index of each element was essential for correct visual representation.
didLeavecan be used to keep track of what elements<TransitionMotion />is still animating.Can also be used as the
onRestequivalent for<TransitionMotion />.