function Link({ component = LinkAnchor, replace, to, children, ...rest }) {
    
    const [router] = useRouter();
    const { history } = router;
    const currentLocation = history.location;

    const location = normalizeToLocation(
        resolveToLocation(to, currentLocation.pathname),
        currentLocation.pathname
    );

    const href = location ? history.createHref(location) : '';
    const navigate = () => {
      const location = resolveToLocation(to, currentLocation);
      const method = replace ? history.replace : history.push;
      method(location);
    };

    return (
      <LinkAnchor
        {...rest}
        href={href}
        navigate={navigate}
      >
      {(children)}
      </LinkAnchor>
    )
}
/**
 * The public API for rendering a history-aware <a>.
 */
The public API for rendering a history-aware .
The public API for rendering a history - aware .
function Link({ component = LinkAnchor, replace, to, children, ...rest }) {
    const [router] = useRouter();
    const { history } = router;
    const currentLocation = history.location;
    const location = normalizeToLocation(
        resolveToLocation(to, currentLocation.pathname),
        currentLocation.pathname
    );
    const href = location ? history.createHref(location) : '';
    const navigate = () => {
      const location = resolveToLocation(to, currentLocation);
      const method = replace ? history.replace : history.push;
      method(location);
    };
    return (
      <LinkAnchor
        {...rest}
        href={href}
        navigate={navigate}
      >
      {(children)}
      </LinkAnchor>
    )
}
function Link ( { component = LinkAnchor , replace , to , children , ... rest } ) { const [ router ] = useRouter ( ) ; const { history } = router ; const currentLocation = history . location ; const location = normalizeToLocation ( resolveToLocation ( to , currentLocation . pathname ) , currentLocation . pathname ) ; const href = location ? history . createHref ( location ) : '' ; const navigate = ( ) => { const location = resolveToLocation ( to , currentLocation ) ; const method = replace ? history . replace : history . push ; method ( location ) ; } ; return ( < LinkAnchor { ... rest } href = { href } navigate = { navigate } > { ( children ) } < / LinkAnchor > ) }
The public API for rendering a history-aware <a>.
The public API for rendering a history - aware <a > .