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

React 18: Property 'children' does not exist on type 'IntrinsicAttributes & PusherProviderProps'. #104

Open
francisashley opened this issue Jan 11, 2023 · 1 comment

Comments

@francisashley
Copy link

Describe the bug

Using usePusher in a React 18 TypeScript project throws the error:

Property 'children' does not exist on type 'IntrinsicAttributes & PusherProviderProps'.

This is because React 18 Requires children?: React.ReactNode to be defined in the component props which is missing here.

@KBeDevel
Copy link

KBeDevel commented Jan 26, 2023

Try this

import type { FC, PropsWithChildren } from 'react'
import {
  PusherProvider as $PusherProvider,
  type PusherProviderProps,
} from '@harelpls/use-pusher'

const PusherProvider = $PusherProvider as FC<
  PropsWithChildren<PusherProviderProps>
>

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

2 participants