mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-29 04:38:55 +03:00
Proper passing of props
This commit is contained in:
parent
4e67edac5e
commit
8b36cef510
1 changed files with 3 additions and 2 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue