-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
fix(Menu): fix typings for Menu.Item #1235
fix(Menu): fix typings for Menu.Item #1235
Conversation
Current coverage is 95.89% (diff: 100%)@@ master #1235 diff @@
==========================================
Files 880 880
Lines 4901 4901
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
Hits 4700 4700
Misses 201 201
Partials 0 0
|
* @param {SyntheticEvent} event - React's original SyntheticEvent. | ||
* @param {object} data - All props. | ||
*/ | ||
onClick?: (event: React.MouseEvent<HTMLElement>, data?:MenuItemProps) => void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there should be space between data?:
and MenuItemProps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data
will be always passed.
-onClick?: (event: React.MouseEvent<HTMLElement>, data?:MenuItemProps) => void;
+onClick?: (event: React.MouseEvent<HTMLElement>, data: MenuItemProps) => void;
I have made both those changes and added them to the PR |
Released in |
Menu.Item throws a compiler error in 0.64.5 (this error did not happen in 0.64.0): error TS2430: Interface 'MenuItemProps' incorrectly extends interface 'ReactMouseEvents'. |
I get the same error when using 0.64.5. |
I've forget to make a response there, it was fixed in #1264. |
* Fix typings for Menu.Item onClink Handler * Fix spacing and make data non-optional
The typings are missing a correct definition for onClick on Menu.Item to add the props as the 2nd parameter.
The typings for Button are correct, so this is a copy of the onClick definition from there for Menu.Item