onInactive gets triggered when view is not on focus
I have implemented the library in several of my views. All of them has a timeout of 10 seconds. When I navigate from View A to View B, the onInactive method of View A still seems to be active and when you travel back (Ex: use pop from navigator), the contents of the method onInactive gets triggered.
How to avoid this?
Great observation @nHiRanZ - most navigators will still keep the screens in the back stack active when navigating forward.
Off the top of my head, I'm not sure what a great solution would be without a deeper dive into this issue.
What navigator are you using? We'd need some way to "suspend" while not on the active navigation screen, and I'm not sure if we can do that w/o coupling ourselves to the navigator
Hi @ajwhite, I'm currently using the NavigatorIOS. Yes was thinking the same, or can we try using the same PanHandler instance throughout using a Worker or something like that?
React's context is probably more appropriate than a Worker for making one thing available to many descendant components -- but either way, I'm not quite sure what you were thinking there. Can you expand on that? What do you have in mind if we shared a single PanHandler instance?