react-native-media-console icon indicating copy to clipboard operation
react-native-media-console copied to clipboard

'react-native-media-console' cannot be used as a JSX component.

Open hasanalicansu opened this issue 8 months ago • 0 comments

Description

Hello, I'm encountering a TypeScript error when trying to use the library:

'MediaConsole' cannot be used as a JSX component.
Its type '(props: Omit<VideoPlayerProps, "animations">) => Element' is not a valid JSX element type.
Type '(props: Omit<VideoPlayerProps, "animations">) => Element' is not assignable to type '(props: any) => ReactNode | Promise'.
Type 'Element' is not assignable to type 'ReactNode | Promise'.
Property 'children' is missing in type 'ReactElement<any, any>' but required in type 'ReactPortal'.ts

Environment

TypeScript version: 5.0.4 React version: 79.2 Steps to Reproduce

Possible Fix

Here is a possible adjustment:

export declare const VideoPlayer: (props: Omit<VideoPlayerProps, 'animations'>) => React.JSX.Element; // instead JSX.Element

hasanalicansu avatar May 12 '25 11:05 hasanalicansu