Property 'apiKey' does not exist
Closed this issue · 2 comments
micheilsgrey commented
Using typescript. apiKey does not exist
error in VS Code:
No overload matches this call.
Overload 1 of 2, '(props: Readonly<YouTubeProps>): YouTube', gave the following error.
Type '{ apiKey: string; videoId: string; play: true; fullscreen: true; loop: true; style: { alignSelf: "stretch"; height: number; }; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<YouTube> & Readonly<YouTubeProps> & Readonly<...>'.
Property 'apiKey' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<YouTube> & Readonly<YouTubeProps> & Readonly<...>'.
Overload 2 of 2, '(props: YouTubeProps, context?: any): YouTube', gave the following error.
Type '{ apiKey: string; videoId: string; play: true; fullscreen: true; loop: true; style: { alignSelf: "stretch"; height: number; }; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<YouTube> & Readonly<YouTubeProps> & Readonly<...>'.
Property 'apiKey' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<YouTube> & Readonly<YouTubeProps> & Readonly<...>'.
code i used :
export default class YoutubePlayer extends Component<PlayerProps, PlayerState> {
render() {
return (
<YouTube
apiKey={'MY_KEY_HERE'} // error here
videoId="40yeK3qI0Pc" // The YouTube video ID
play // control playback of video with true/false
fullscreen // control whether the video should play in fullscreen or inline
loop // control whether the video should loop when ended
style={{ alignSelf: 'stretch', height: 300 }}
/>
);
}
}
m-inan commented
This is only because the props have not been added. 0e894bf If this request is added, the error message will not appear in the next version.
micheilsgrey commented
This is only because the props have not been added. 0e894bf If this request is added, the error message will not appear in the next version.
Got it. Thank you.