Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Speed up animation on back button press + animated reattach on tab sw…
…itch Summary: When hiding a view with React.Activity, React will "detach" all the views in teh subtree (call all their effect cleanups) and then upon showing it again will attach them (call all their effects again). This was previously causing problems with useAnimatedProps and facebook#46205 was intended to fix it (cc javache), but it's still a perf drain to have to detach all of this and then re-attach it upon show. Worse, it makes it so that we can't actually do any animations upon re-showing a view until all the passive effects have run to re-attach the views to the animations. So instead, what this diff does is lean on the fact that useInsertionEffect *does not* clean up and rerun when Activity goes from hidden to visible and vice versa. Thus, we can rely on it to only detach the animated node when we're *actually* unmounting - rather than when we're simply hiding/showing. Reviewed By: yungsters, sammy-SC Differential Revision: D62398039
- Loading branch information