-
Notifications
You must be signed in to change notification settings - Fork 651
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
Add transition stage argument to addEndListener #389
Comments
I think we've got this covered by #327 ?
It's not required! you can leave off the timeout if you use an endListener, it maybe still be beneficial to use both tho depending on what the end listener is, not a problem with GSAP tho |
@jquense I don't understand how #327 addresses this case, that issue is about classes, and I'm interested in adding an extra
Oh, yes indeed, the warning isn't triggered when |
O see, no we won't add that, the callbacks are just that, callbacks. They are informative events, not hooks for controlling the the flow. I think what you want is to avoid timeouts entirely and do all the work in the addEndListener, which can setup and control when the end callbacks are fired. |
Why not let the hooks control transition stage change? In GSAP case it’s natural and essential. I don’t mind if I could do GSAP tweens in addEndListener, but there is no information about the current transition stage. I try to make available both stage info from onEntering/onExiting and done callback from addEndListener to GSAP timeline with help of a wrapper component, but race condition still trips me up. |
I'm happy to add the current t stage to the end listener, I think that's a good addition if you are up for sending a PR. Adding done handlers to the callbacks isn't feasible architecturually tho |
OK, I’ll try to come up with a PR. |
Closed due to discovered workaround. |
Do you want to request a feature or report a bug?
A feature.
What is the current behavior?
I'm trying to use RTG together with GSAP for route transitions. I need GSAP's timeline feature because transitions are pretty involved.
By the end of a GSAP timeline it would be sweet to call a callback to switch to the next transition state.
Currently,
done
callback is only available inaddEndListener
prop. Using it in context of lifecycle hooks (onEntering
/onExiting
etc.) requires a wrapper component, that's a complexity on the user side that could be avoided.As a side note, requiring timeout prop doesn't look right when you come to rely on done callback.
The text was updated successfully, but these errors were encountered: