Created
June 1, 2018 10:26
-
-
Save smashercosmo/9fe7d58666ba3df26990a8b00b1da297 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { AnchorHTMLAttributes } from 'react' | |
import { NavLink, NavLinkProps } from 'react-router-dom' | |
const Link: React.SFC<NavLinkProps | AnchorHTMLAttributes> = props => { | |
if (props.to) { | |
return <NavLink {...props} /> | |
} | |
return <a {...props} /> | |
} | |
export default Link |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment