Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hashQueryKey is not exported from tanstack/react-query #224

Open
0x1h opened this issue Dec 19, 2024 · 0 comments
Open

hashQueryKey is not exported from tanstack/react-query #224

0x1h opened this issue Dec 19, 2024 · 0 comments

Comments

@0x1h
Copy link

0x1h commented Dec 19, 2024

I was setting up @tanstack/react-query in electron app, but on v5 it shows error

hashQueryKey is not exported from tanstack/react-query

this error appears because in v5 hashQueryKey was renamed to hashKey

This is my App.tsx demo, same as you have in examples, I downgraded @tanstack/react-query on 4.36.1 and works fine

import { RouterProps, RouterProvider } from '@tanstack/react-router'
import { createTRPCReact } from '@trpc/react-query'
import { useState } from 'react'
import type { AppRouter } from '../../main/api/index'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { ipcLink } from 'electron-trpc/renderer'

type AppProps = { router: RouterProps['router'] }
const api = createTRPCReact<AppRouter>()

const App = ({ router }: AppProps) => {
  const [queryClient] = useState(() => new QueryClient())
  const [trpcClient] = useState(() =>
    api.createClient({
      links: [ipcLink()]
    })
  )

  return (
    <api.Provider client={trpcClient} queryClient={queryClient}>
      <QueryClientProvider client={queryClient}>
        <div className="mt-6">
          <div className="title-bar-area" />
          <RouterProvider router={router} />
        </div>
      </QueryClientProvider>
    </api.Provider>
  )
}

export default App
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant