import { h } from 'preact' import { useRouteMatch } from 'react-router-dom' import { A } from '../Text' import { RRLink } from './styles' const Link = ({ children, to, activeOnlyWhenExact = true, href, textProps: { colour, size, weight } = {}, navLink, ...rest }) => { const match = useRouteMatch({ path: to, exact: activeOnlyWhenExact }) return href ? {children} : ( {children} ) } export default Link