-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
expose onTransitionEnd event for react components #2187
Comments
👍 to this. Even as a plugin would be helpful. |
👍 currently using this workaround: componentDidUpdate: function() {
this.getDOMNode().addEventListener('transitionend', this.onTransitionEnd, false);
} Would prefer to do: <MyComponent onTransitionEnd={this.onTransitionEnd} /> |
+1 |
FYI, "faking it" as @shilpan mentioned may be harder than it seems. Apparently the native |
Any update regarding this feature? |
+1 |
👍 |
1 similar comment
👍 |
👍 that would amazing ;) |
👍 |
1 similar comment
+1 |
+1 |
This was fixed by #6005 & be in v15. |
See context from #2187 for background about control dependencies. Our current `PruneNonReactiveIdentifiers` pass runs on ReactiveFunction, after scope construction, and removes scope dependencies that aren't reactive. It works by first building up a set of reactive identifiers in `InferReactiveIdentifiers`, then walking the ReactiveFunction and pruning any scope dependencies that aren't in that set. The challenge is control variables, as demonstrated by the test cases in #2184. `InferReactiveIdentifiers` runs against ReactiveFunction, and when we initially wrote it we didn't consider control variables. To handle control variables we really need to use precise control- & data-flow analysis, which is much easier with HIR. This PR adds the start of `InferReactivePlaces`, which annotates each `Place` with whether it is reactive or not. This allows the annotation to survive LeaveSSA, which swaps out the identifiers of places but leaves other properties as-is. This version does _not_ yet handle control variables, but it's already more precise than our existing inference. In our current inference, if `x` is ever assigned a reactive value, then all `x`s are marked reactive. In our new inference, each instance of `x` (each Place) gets a separate flag based on whether x can actually be reactive at that point in the program. There are two main next steps (in follow-up PRs): * Update the mechanism by which we prune non-reactive dependencies from scopes. * Handle control variables. I think we may be able to use dominator trees to figure out the set of basic blocks whose reachability is gated by the control variables. This should clearly work for if/else and switch, as for loops i'm not sure but intuitively it seems right.
An
onTransitionEnd
event for components which is normalized across all browsers supporting transitions (and fake it for those that don't usingsetTimeout
). Currently react usesReactTransitionEvents
internally for theTransitionGroup
. However this is not useful in cases where you are not adding/removing a view.The text was updated successfully, but these errors were encountered: