[InteractionManager] What are the best practices around using InteractionManager? #2248

Closed
paramaggarwal opened this Issue Aug 6, 2015 · 7 comments

Comments

Projects
None yet
3 participants
@paramaggarwal
Contributor

paramaggarwal commented Aug 6, 2015

I searched the code base and no one is using runAfterInteractions currently. I see that the Animated library is setting createInteractionHandle correctly. I can't seem to find some proper guidance around where to smartly stop work when interaction is in progress.

Could someone please guide me or point me to some example that uses this API to ensure great performance and interactivity? Feel free to close otherwise, thanks!

@brentvatne

This comment has been minimized.

Show comment
Hide comment
@brentvatne

brentvatne Aug 6, 2015

Collaborator

This is really useful when you are pushing to a new route with Navigator - on the component that you are rendering you can defer rendering any expensive views by having some state like transitionComplete that initializes to false and blocks rendering of those views, then set it to true in the runAfterInteractions callback so the views can render. I've done this on an app to get much smoother animated transitions.

Collaborator

brentvatne commented Aug 6, 2015

This is really useful when you are pushing to a new route with Navigator - on the component that you are rendering you can defer rendering any expensive views by having some state like transitionComplete that initializes to false and blocks rendering of those views, then set it to true in the runAfterInteractions callback so the views can render. I've done this on an app to get much smoother animated transitions.

@paramaggarwal

This comment has been minimized.

Show comment
Hide comment
@paramaggarwal

paramaggarwal Aug 6, 2015

Contributor

Ah I see. Any use-case regarding scrolling interaction esp. on a ListView?

Contributor

paramaggarwal commented Aug 6, 2015

Ah I see. Any use-case regarding scrolling interaction esp. on a ListView?

@brentvatne

This comment has been minimized.

Show comment
Hide comment
@brentvatne

brentvatne Aug 6, 2015

Collaborator

@paramaggarwal - not that I know of, I don't believe that ListView creates any interaction handles, just Navigator and Animated at the moment.

Collaborator

brentvatne commented Aug 6, 2015

@paramaggarwal - not that I know of, I don't believe that ListView creates any interaction handles, just Navigator and Animated at the moment.

@paramaggarwal

This comment has been minimized.

Show comment
Hide comment
@paramaggarwal

paramaggarwal Aug 6, 2015

Contributor

That answers my question. Thanks @brentvatne!

Contributor

paramaggarwal commented Aug 6, 2015

That answers my question. Thanks @brentvatne!

@brentvatne

This comment has been minimized.

Show comment
Hide comment
@brentvatne

brentvatne Sep 6, 2015

Collaborator

Posting usage example repo link here so it's easy to reference: https://github.com/brentvatne/run-after-interactions-exp

Collaborator

brentvatne commented Sep 6, 2015

Posting usage example repo link here so it's easy to reference: https://github.com/brentvatne/run-after-interactions-exp

@JonathanZWhite JonathanZWhite referenced this issue in dancormier/react-native-swipeout Mar 7, 2016

Closed

setState on unmounted component? #52

@vonovak vonovak referenced this issue in aksonov/react-native-router-flux Jul 16, 2016

Closed

How to know when transition animation has ended #906

@diegoddox

This comment has been minimized.

Show comment
Hide comment
@diegoddox

diegoddox Jun 15, 2018

@brentvatne thanks for the repo (run-after-interactions-exp) that you've made, I was wondering if it will have any good effect to call fetch inside of a runAfterInteractions?

Thanks in advance.

diegoddox commented Jun 15, 2018

@brentvatne thanks for the repo (run-after-interactions-exp) that you've made, I was wondering if it will have any good effect to call fetch inside of a runAfterInteractions?

Thanks in advance.

@brentvatne

This comment has been minimized.

Show comment
Hide comment
@brentvatne

brentvatne Jun 15, 2018

Collaborator

probably doesn't matter. you could put doing something in response to the fetch completing inside of it but the actual fetch is not going to make your app drop frames

Collaborator

brentvatne commented Jun 15, 2018

probably doesn't matter. you could put doing something in response to the fetch completing inside of it but the actual fetch is not going to make your app drop frames

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment