question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update docs related to react-query

See original GitHub issue

Is your feature request related to a problem? Please describe.

Currently in the docs https://mswjs.io/docs/faq#react-query the method to clear query cache is outdated with ver3 released.

Describe the solution you’d like

We need to replace

import { queryCache } from 'react-query'
beforeEach(() => {
  queryCache.clear()
})

with

let queryClient: QueryClient;
beforeEach(() => {
  queryClient = new QueryClient();
});
afterEach(() => {
  queryClient.clear();
});

Describe alternatives you’ve considered

🤔

Additional context

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
adeelibrcommented, Jan 28, 2021

@adeelibr would you be interested in shipping a pull request to the website repo? I like the QueryClient option.

I will make a PR for it today 👍

1reaction
kettanaitocommented, Jan 29, 2021

Fixed by https://github.com/mswjs/mswjs.io/pull/127. The page is now live. Thank you once more. @adeelibr.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Query - Hooks for fetching, caching and updating ...
Performant and powerful data synchronization for React. Fetch, cache and update data in your React and React Native applications all without touching any ......
Read more >
Fetching and Updating Data with React Query
In this article, we will discuss using React Query in React applications, and learn how to fetch and update a list of users...
Read more >
Building The Real App With React Query - Smashing Magazine
React Query has an impressive list of features: caching;; deduping multiple requests for the same data into a single request;; updating “out ...
Read more >
How to Query through a list of documents and then update the ...
I would like to change the name of every state that named boston in my collection of document in firestore how can I...
Read more >
Getting Started with React-Query for Data Fetching and State ...
Using React Query, we can fetch, cache, and update data in React-based applications in a simple and declarative manner without mutating the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found