Skip to content
Discussion options

You must be logged in to vote

but the polling can't be resumed when we come back to the 'Home' tab

hmm, have you tried calling refetchQueries on the query that should poll manually once when you go back to the home tab? I'm thinking that this should re-trigger the interval function, and it works in this forked sandbox:

https://codesandbox.io/s/rn-polling-demo-forked-yzvwzk?file=/src/App.js

Another idea I had: polling stops if the app is seen as not focussed, unless you turn on refetchIntervalInBackground: true. This is determined by the global focusManager. Now you can set your own focus event handling there and set it to focused: false manually if you switch away to a different tab where no polling should occur. No…

Replies: 1 comment 13 replies

Comment options

You must be logged in to vote
13 replies
@mk-nickyang
Comment options

@mk-nickyang
Comment options

@mk-nickyang
Comment options

@TkDodo
Comment options

Answer selected by mk-nickyang
@mk-nickyang
Comment options

@TkDodo
Comment options

@mk-nickyang
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants