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

'HoverMenu' cannot be used as a JSX component #119

Open
mojtaba-hajishah opened this issue Apr 9, 2023 · 1 comment
Open

'HoverMenu' cannot be used as a JSX component #119

mojtaba-hajishah opened this issue Apr 9, 2023 · 1 comment

Comments

@mojtaba-hajishah
Copy link

I get this Typescript error when I use the HoverMenu component:

'HoverMenu' cannot be used as a JSX component.
 Its element type 'ReactElement<any, any> | Component<MenuProps, any, any> | null' is not a valid JSX element.
 Type 'Component<MenuProps, any, any>' is not assignable to type 'Element | ElementClass | null'.
 Type 'Component<MenuProps, any, any>' is not assignable to type 'ElementClass'.
 The types returned by 'render()' are incompatible between these types.

@jedwards1211
Copy link
Member

Sorry for the long delay, can you tell me what version of this package and of TypeScript you're using?
This is pretty mysterious, in material-ui-popup-state 4.1.0 and in v5 it's been declared as HoverMenu: React.ComponentType<MenuProps>, which should be pretty foolproof, and it's weird that Component is winding up among the possible element types.

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