Skip to content

React Native refetching on refocus and/or remount #296

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: 11 comments 16 replies

You must be logged in to vote
6 replies
@cherniavskii

@Luccasoli

@iaurg

@Gbengaol

@mohitharshan123

Answer selected by kelleyvanevert

You must be logged in to vote
0 replies

You must be logged in to vote
5 replies
@kelleyvanevert

@safaiyeh

@zluo01

@Gbengaol

@clytras

You must be logged in to vote
0 replies

You must be logged in to vote
1 reply
@Rehubbard

You must be logged in to vote
0 replies

You must be logged in to vote
0 replies

You must be logged in to vote
1 reply
@Danhhan

You must be logged in to vote
3 replies
@TkDodo

@je00037

@TkDodo

You must be logged in to vote
0 replies

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