import * as React from 'react'; import { StatelessComponent, HTMLProps } from 'react'; import { NavProvider } from './NavProvider'; import { LocationDescriptorObject } from 'history'; import { Match, ValOrFunc } from './utils'; export type LinkProps = HTMLProps & { to: ValOrFunc<(string | LocationDescriptorObject)>; activeClassName?: string; match?: ValOrFunc; replace?: boolean; noSubscribe?: boolean; }; export const Link: StatelessComponent = (props: LinkProps) => { const { to, match, noSubscribe, replace, activeClassName = '', className, ...aProps } = props; return ( ( { if (aProps.onClick) { aProps.onClick(e); } return params.handleAnchorClick(e); }} /> )} /> ); };