tjallingt/react-youtube

onReady event target type is wrong after v8.1.0

esetnik opened this issue ยท 7 comments

  const handleReady: YouTubeProps['onReady'] = ({
    target,
  }: {
    target: YT.Player;
  }) => {
    console.log('youtube player is ready', target, autoplay);
  };
src/Components/YoutubePlayer.tsx:45:9 - error TS2322: Type '({ target, }: { target: YT.Player; }) => void' is not assignable to type '((event: CustomEvent<any>) => void) & (() => void)'.
  Type '({ target, }: { target: YT.Player; }) => void' is not assignable to type '(event: CustomEvent<any>) => void'.
    Types of parameters '__0' and 'event' are incompatible.
      Type 'CustomEvent<any>' is not assignable to type '{ target: Player; }'.
        Types of property 'target' are incompatible.
          Type 'EventTarget | null' is not assignable to type 'Player'.
            Type 'null' is not assignable to type 'Player'.

45   const handleReady: YouTubeProps['onReady'] = ({

@esetnik thanks for the report. I'll take a look into it later today!

๐ŸŽ‰ This issue has been resolved in version react-youtube-v8.2.0-canary.2 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

๐ŸŽ‰ This issue has been resolved in version react-youtube-v8.2.1-canary.1 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

๐ŸŽ‰ This issue has been resolved in version react-youtube-v8.2.1 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

@esetnik Can you try using the latest version 8.2.1?

@ruisaraiva19 looks great thanks!

@esetnik Awesome! ๐ŸŽ‰