rqn

react-query-navigation-native

React Query integration with React Navigation

Showing:

Popularity

Downloads/wk

3

GitHub Stars

19

Maintenance

Last Commit

6mos ago

Contributors

1

Package

Dependencies

0

Size (min+gzip)

0.4KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

react-query-navigation-native

Integrates React Query with React Navigation for React Native apps.

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)

Installation

$ npm i --save react-query-navigation-native
# or
$ yarn add react-query-navigation-native

Make sure, that you have react-query installed.

Usage

react-query-navigation-native re-exports everything from react-query. This means, that you can replace imports from react-query to react-query-navigation-native everywhere in your app and use it as earlier.

// import everything from react-query-navigation-native
- import { useQuery, useMutation, queryCache } from 'react-query'
+ import { useQuery, useMutation, queryCache } from 'react-query-navigation-native'

// or just import useQuery from react-query-navigation-native
- import { useQuery, useMutation, queryCache } from 'react-query'
+ import { useMutation, queryCache } from 'react-query'
+ import { useQuery } from 'react-query-navigation-native'

Docs

See react-query docs

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100