Skip to content

Commit

Permalink
fix(ReactQueryCacheProvider): use shared queryCaches (TanStack#768)
Browse files Browse the repository at this point in the history
`ReactQueryCacheProvider` uses own `queryCaches`, looks like a typo after refactoring.

Due to that typo, `onWindowFocus` is completely broken when isolated query cache is used.
  • Loading branch information
khmm12 authored and tannerlinsley committed Jul 17, 2020
1 parent ff20232 commit 29b9233
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/react/ReactQueryCacheProvider.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import React from 'react'
import { queryCache, makeQueryCache } from '../core'
import { queryCache as defaultQueryCache, queryCaches, makeQueryCache } from '../core'

export const queryCacheContext = React.createContext(queryCache)

export const queryCaches = [queryCache]
export const queryCacheContext = React.createContext(defaultQueryCache)

export const useQueryCache = () => React.useContext(queryCacheContext)

Expand Down

0 comments on commit 29b9233

Please sign in to comment.