parent
baace23719
commit
967f54a5c9
2 changed files with 27 additions and 0 deletions
@ -0,0 +1,20 @@ |
||||
import { FunctionComponent } from 'react'; |
||||
import Link from 'next/link'; |
||||
|
||||
import { SimpleLinkProps } from '../../types/SimpleLinkProps'; |
||||
|
||||
const SimpleLink: FunctionComponent<SimpleLinkProps> = ({ |
||||
linkProps, |
||||
anchorProps = {}, |
||||
children, |
||||
}) => { |
||||
return ( |
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
<Link {...{ passRef: true, ...linkProps }}> |
||||
{/* eslint-disable-next-line react/jsx-props-no-spreading */} |
||||
<a {...anchorProps}>{children}</a> |
||||
</Link> |
||||
); |
||||
}; |
||||
|
||||
export default SimpleLink; |
@ -0,0 +1,7 @@ |
||||
import { AnchorHTMLAttributes } from 'react'; |
||||
import { LinkProps } from 'next/link'; |
||||
|
||||
type SimpleLinkProps = { |
||||
linkProps: Omit<LinkProps, 'passRef'>; |
||||
anchorProps?: AnchorHTMLAttributes<HTMLAnchorElement>; |
||||
}; |
Loading…
Reference in new issue