diff --git a/src/link.tsx b/src/link.tsx index c5060ef..9db51a1 100644 --- a/src/link.tsx +++ b/src/link.tsx @@ -8,6 +8,7 @@ import { useRouter } from "./router-provider"; export type LinkProps = { to: RouteInstance | string; params?: Params; + replace?: boolean; query?: RouteQuery; className?: string; activeClassName?: string; @@ -18,7 +19,7 @@ const LinkView = ( props: LinkProps, ref: ForwardedRef, ) => { - const { to, params, query, activeClassName, inactiveClassName, ...linkProps } = props; + const { to, params, query, activeClassName, inactiveClassName, replace, ...linkProps } = props; if (typeof props.to === "string") { return ( @@ -48,6 +49,7 @@ const RouteLinkView = ( onClick, children, target, + replace, ...linkProps } = props; @@ -97,6 +99,7 @@ const RouteLinkView = ( navigate({ params: params || ({} as Params), query: query || {}, + replace, }); }} >