Setup React Query
23 July 2023 (Updated 23 July 2023)
Install package
npm i react-query
Wrap your app in the <QueryClientProvider>
// Create a client
const queryClient = new QueryClient()
function App() {
return (
// Provide the client to your App
<QueryClientProvider client={queryClient}>
<YourComponents />
<ReactQueryDevtools initialIsOpen={false} />
</QueryClientProvider>
)
}
Sources
Tagged:
React Query
Thanks for your comment 🙏. Once it's approved, it will appear here.
Leave a comment