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

Add transition stage argument to addEndListener #389

Closed
mvasin opened this issue Aug 9, 2018 · 7 comments
Closed

Add transition stage argument to addEndListener #389

mvasin opened this issue Aug 9, 2018 · 7 comments

Comments

@mvasin
Copy link
Contributor

mvasin commented Aug 9, 2018

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 in addEndListener 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.

@jquense
Copy link
Collaborator

jquense commented Aug 9, 2018

I think we've got this covered by #327 ?

As a side note, requiring timeout prop doesn't look right when you come to rely on done callback.

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

@mvasin
Copy link
Contributor Author

mvasin commented Aug 9, 2018

@jquense I don't understand how #327 addresses this case, that issue is about classes, and I'm interested in adding an extra done callback as parameter to functions onEntering and onExiting. The goal is not to specify duration information twice, in timeout and on GSAP timeline.

It's not required!

Oh, yes indeed, the warning isn't triggered when addEndListener is specified.

@jquense
Copy link
Collaborator

jquense commented Aug 9, 2018

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.

@mvasin
Copy link
Contributor Author

mvasin commented Aug 10, 2018

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.

@jquense
Copy link
Collaborator

jquense commented Aug 10, 2018

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

@mvasin
Copy link
Contributor Author

mvasin commented Aug 10, 2018

OK, I’ll try to come up with a PR.

@mvasin mvasin changed the title Add done callback argument to all <Transition /> lifecycle hooks Add transition stage argument to addEndListener Aug 10, 2018
@mvasin
Copy link
Contributor Author

mvasin commented Aug 17, 2018

Closed due to discovered workaround.

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