@dr.pogodin/react-utils
Version:
Collection of generic ReactJS components and utils
13 lines (12 loc) • 526 B
TypeScript
/**
* The Link wraps around React Router's Link component, to automatically replace
* it by the regular <a> element when:
* - The target reference points to another domain;
* - User opts to open the reference in a new tab;
* - User explicitely opts to use <a>.
*/
import { type LinkProps } from 'react-router';
import { type PropsT as GenericLinkPropsT } from './GenericLink';
type PropsT = Omit<GenericLinkPropsT, 'routerLinkType'> & LinkProps;
declare const Link: React.FunctionComponent<PropsT>;
export default Link;