You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
383 B
17 lines
383 B
import * as React from 'react';
|
|
export var IdContext = /*#__PURE__*/React.createContext(null);
|
|
export function getMenuId(uuid, eventKey) {
|
|
if (uuid === undefined) {
|
|
return null;
|
|
}
|
|
|
|
return "".concat(uuid, "-").concat(eventKey);
|
|
}
|
|
/**
|
|
* Get `data-menu-id`
|
|
*/
|
|
|
|
export function useMenuId(eventKey) {
|
|
var id = React.useContext(IdContext);
|
|
return getMenuId(id, eventKey);
|
|
} |