Proper passing of props

This commit is contained in:
Lim Chee Aun 2024-03-04 09:52:22 +08:00
parent 4e67edac5e
commit 8b36cef510

View file

@ -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)