Skip to content

React Native refetching on refocus and/or remount #296

Discussion options

You must be logged in to vote

React Navigation is one of the available options when it comes to React Native. This means that ReactQuery cannot assume that it's used in every app. Therefore it won't be supported out of the box.

But I've created this small library https://github.com/cherniavskii/react-query-navigation-native to help integrate react-query with react-navigation.
Features:

  • Automatically refetch queries on app focus (by subscribing to AppState)
  • Automatically refetch query on screen focus in useQuery hook (by using useFocusEffect from React Navigation)

Replies: 10 comments 16 replies

Comment options

You must be logged in to vote
6 replies
@cherniavskii
Comment options

@Luccasoli
Comment options

@iaurg
Comment options

@Gbengaol
Comment options

@mohitharshan123
Comment options

Answer selected by kelleyvanevert
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@kelleyvanevert
Comment options

@safaiyeh
Comment options

@zluo01
Comment options

@Gbengaol
Comment options

@clytras
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Rehubbard
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Danhhan
Comment options

Comment options

You must be logged in to vote
3 replies
@TkDodo
Comment options

@je00037
Comment options

@TkDodo
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment