Replies: 1 comment
-
you can just wrap all your individual screen components in a |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I want to use react-query (aka TanStack / query) in react native application. In this case I need to somehow provide
QueryClient
to the component, but there's no single point where I can do this (like in web react application). Every navigation screen is an independent component.RNN (wix/react-native-navigation) has React Context API for doing this https://wix.github.io/react-native-navigation/docs/third-party-react-context , but as they mention
As RNN screens are not part of the same component tree, updating the values in the shared context does not trigger a re-render across all screens. However you can still use the React.Context per RNN screen component tree.
Is there any workaround or best practice on how to combine RNN and react-query to provide
QueryClient
to every component?Would this
re-render via react context
thing break anything and in what cases?Thanks.
Beta Was this translation helpful? Give feedback.
All reactions