wslyvh / nexth

A Next.js + Ethereum starter kit with Viem, Wagmi, Web3Modal, SIWE, Tailwind, daisyUI and more to quickly ship production-ready Web3 Apps ⚡
https://nexth.vercel.app/
MIT License
671 stars 141 forks source link

tanstack? #27

Closed alexrmacleod closed 9 months ago

alexrmacleod commented 9 months ago

why did you not wrap tanstack/react-query around your app as suggested in the wagmi docs?

'use client'

import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { useState, type ReactNode } from 'react'
import { WagmiProvider } from 'wagmi'

import { config } from '@/wagmi'

export function Providers(props: { children: ReactNode }) {
  const [queryClient] = useState(() => new QueryClient())

  return (
    <WagmiProvider config={config}>
      <QueryClientProvider client={queryClient}>
        {props.children}
      </QueryClientProvider>
    </WagmiProvider>
  )
}
wslyvh commented 9 months ago

This only recently changed in wagmi v2 (making tanstack a peer dependency) and wasn't necessary before afaik Will close this, but open an issue to upgrade major packages to their latest versions.