Replies: 1 comment
-
|
This is a TypeScript types version conflict — specifically, duplicate or mismatched Diagnosenpm ls @types/react
# or
pnpm ls @types/react --depth=3You will likely see two different versions (e.g., Fix 1: Force a single version (recommended)npm — add to {
"overrides": {
"@types/react": "^19.0.0"
}
}pnpm — add to {
"pnpm": {
"overrides": {
"@types/react": "^19.0.0"
}
}
}yarn — add to {
"resolutions": {
"@types/react": "^19.0.0"
}
}Then delete rm -rf node_modules package-lock.json
npm installFix 2: Align your dependency versionsMake sure wagmi, @tanstack/react-query, and your React types are all targeting the same React major version: npm install @types/react@latest @types/react-dom@latest
npm install wagmi@latest @tanstack/react-query@latestFix 3: TypeScript
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
'use client'
import { WagmiProvider } from 'wagmi'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { config } from '@/lib/wallet'
import { ReactNode, useState } from 'react'
interface WalletProviderProps {
children: ReactNode
}
function WalletProviderInner({ children, queryClient }: WalletProviderProps & { queryClient: QueryClient }) {
return (
{children}
)
}
export default function WalletProvider({ children }: WalletProviderProps) {
const [queryClient] = useState(() => new QueryClient())
return (
{children}
)
}==in this showing (WagmiProvider' cannot be used as a JSX component.
Its type '(parameters: PropsWithChildren) => FunctionComponentElement<PropsWithChildren>' is not a valid JSX element type.
Type '(parameters: PropsWithChildren) => FunctionComponentElement<PropsWithChildren>' is not assignable to type '(props: any, deprecatedLegacyContext?: any) => ReactNode'.
Type 'FunctionComponentElement<PropsWithChildren>' is not assignable to type 'ReactNode'.
Property 'children' is missing in type 'FunctionComponentElement<PropsWithChildren>' but required in type 'ReactPortal'.ts(2786)
index.d.ts(379, 9): 'children' is declared here.)
Beta Was this translation helpful? Give feedback.
All reactions