Skip to content

Commit

Permalink
chore: forward 'to' along to RR
Browse files Browse the repository at this point in the history
Signed-off-by: Logan McAnsh <[email protected]>
  • Loading branch information
mcansh committed Jan 25, 2023
1 parent f5602b7 commit 40e0b6f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/remix-react/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ function usePrefetchBehavior(
*/
let NavLink = React.forwardRef<HTMLAnchorElement, RemixNavLinkProps>(
({ to, prefetch = "none", ...props }, forwardedRef) => {
// `location` is the unaltered href we will render in the <a> tag for absolute URLs
let location = typeof to === "string" ? to : createPath(to);
let isAbsolute =
/^[a-z+]+:\/\//i.test(location) || location.startsWith("//");
Expand All @@ -310,7 +309,7 @@ let NavLink = React.forwardRef<HTMLAnchorElement, RemixNavLinkProps>(
<>
<RouterNavLink
ref={forwardedRef}
to={location}
to={to}
{...props}
{...prefetchHandlers}
/>
Expand All @@ -332,7 +331,6 @@ export { NavLink };
*/
let Link = React.forwardRef<HTMLAnchorElement, RemixLinkProps>(
({ to, prefetch = "none", children, ...props }, forwardedRef) => {
// `location` is the unaltered href we will render in the <a> tag for absolute URLs
let location = typeof to === "string" ? to : createPath(to);
let isAbsolute =
/^[a-z+]+:\/\//i.test(location) || location.startsWith("//");
Expand Down

0 comments on commit 40e0b6f

Please sign in to comment.