Skip to content

When using html tags inside Menu it throws errors: React does not recognize the eventKey prop on a DOM element. #407

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

Closed
Dorious opened this issue Jun 8, 2021 · 4 comments
Assignees

Comments

@Dorious
Copy link

Dorious commented Jun 8, 2021

I get an error while using normal html tags inside <Menu>:
React does not recognize the eventKey prop on a DOM element.....
React does not recognize the warnKey prop on a DOM element.....

Easy reproduce

<Menu>
   <div /> 
</Menu>

Funny but when you use React component it doens't have that problem, this doesn't throw anything:

const Comp = () = <div />

<Menu>
  <Comp />
</Menu>

image

@ChromasIV
Copy link

Having the same issue...anyone had any luck?

@ChromasIV
Copy link

Seems that you need to use MenuItem as intended and if not exported right when under the Menu tag it will throw these issues. Hope that helps.

@zombieJ
Copy link
Member

zombieJ commented Sep 23, 2021

https://ant.design/components/menu/#Notes-for-developers

@zombieJ zombieJ closed this as completed Sep 23, 2021
@mkuysunov
Copy link

I resolve this problem like this
`
const MenuHeader = (props) => (

yout code (JSX)
);

yout code (JSX) `

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

4 participants