mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-14 14:00:26 +00:00
Merge pull request #33140 from erik-beus/menuitem-value
Allow any for value prop on MenuItem in react-aria-menubutton
This commit is contained in:
+2
-2
@@ -1,4 +1,4 @@
|
||||
// Type definitions for react-aria-menubutton 6.1
|
||||
// Type definitions for react-aria-menubutton 6.2
|
||||
// Project: https://github.com/davidtheclark/react-aria-menubutton
|
||||
// Definitions by: Muhammad Fawwaz Orabi <https://github.com/forabi>
|
||||
// Chris Rohlfs <https://github.com/crohlfs>
|
||||
@@ -100,7 +100,7 @@ export interface MenuItemProps<T extends HTMLElement>
|
||||
* If value has a value, it will be passed to the onSelection handler
|
||||
* when the `MenuItem` is selected
|
||||
*/
|
||||
value?: string | boolean | number;
|
||||
value?: any;
|
||||
|
||||
/**
|
||||
* If `text` has a value, its first letter will be the letter a user can
|
||||
|
||||
@@ -121,3 +121,18 @@ closeMenu("", { focusMenu: true });
|
||||
|
||||
openMenu("");
|
||||
openMenu("", { focusMenu: true });
|
||||
|
||||
class ObjectMenuItem extends React.Component {
|
||||
render() {
|
||||
const itemValue = { name: "Test name", label: "Only item to select" };
|
||||
return (
|
||||
<Wrapper onSelection={(value) => console.log(value.name)}>
|
||||
<li>
|
||||
<MenuItem value={itemValue} >{itemValue.label}</MenuItem>
|
||||
</li>
|
||||
</Wrapper>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
ReactDOM.render(<ObjectMenuItem />, document.body);
|
||||
|
||||
Reference in New Issue
Block a user