Proper passing of props

pull/441/head
Lim Chee Aun 2024-03-04 09:52:22 +08:00
rodzic 4e67edac5e
commit 8b36cef510
1 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -3,11 +3,12 @@ import { FocusableItem } from '@szhsin/react-menu';
import Link from './link'; import Link from './link';
function MenuLink(props) { function MenuLink(props) {
const { className, disabled, ...restProps } = props;
return ( return (
<FocusableItem> <FocusableItem className={className} disabled={disabled}>
{({ ref, closeMenu }) => ( {({ ref, closeMenu }) => (
<Link <Link
{...props} {...restProps}
ref={ref} ref={ref}
onClick={({ detail }) => onClick={({ detail }) =>
closeMenu(detail === 0 ? 'Enter' : undefined) closeMenu(detail === 0 ? 'Enter' : undefined)