daily-co / daily-react

React hooks and components to get started with Daily
https://docs.daily.co/reference/daily-react
BSD 2-Clause "Simplified" License
53 stars 16 forks source link

Typescript Bug with daily-react-hooks #1

Closed ghost closed 2 years ago

ghost commented 2 years ago

Expected behavior

When utilizing the DailyProvider component in a Next.js typescript app, I should be able to pass children as props to the component, as outlined in the docs.

Describe the bug (unexpected behavior)

When utilizing the DailyProvider component and passing children, I am receiving this error on DailyProvider:

Type '{ children: never[]; url: string; }' is not assignable to type 'IntrinsicAttributes & Props'.
  Property 'children' does not exist on type 'IntrinsicAttributes & Props'.

Steps to reproduce

  1. Install @daily-co/daily-react-hooks to a Next.js typescript project utilizing Next ^12.1.5.
  2. Add DailyProvider to a page component.
  3. Pass a url and children to the provider.
  4. See error.

Screenshots

System information

* Device: Macbook Pro * OS, version: Monterey, 12.3.1 * Browser, version: Chrome, Version 101.0.4951.54 # Additional context
Regaddi commented 2 years ago

Thank you @jrandallw for raising the issue.

This looks like an issue with the updated React 18 typings. We'll update the types for the React components to support usage within React 18.

Regaddi commented 2 years ago

This issue has been fixed with 0.2.3.

ghost commented 2 years ago

Awesome, thanks @Regaddi.