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';
function MenuLink(props) {
const { className, disabled, ...restProps } = props;
return (
<FocusableItem>
<FocusableItem className={className} disabled={disabled}>
{({ ref, closeMenu }) => (
<Link
{...props}
{...restProps}
ref={ref}
onClick={({ detail }) =>
closeMenu(detail === 0 ? 'Enter' : undefined)