Skip to content

Commit

Permalink
Use preserveUrl with Link Component
Browse files Browse the repository at this point in the history
Add preserveUrl to Link component props.
  • Loading branch information
thoresuenert authored Jan 19, 2025
1 parent 66985bf commit cf60b3c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/react/src/Link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ interface BaseInertiaLinkProps {
onClick?: (event: React.MouseEvent<Element>) => void
preserveScroll?: PreserveStateOption
preserveState?: PreserveStateOption
preserveUrl: boolean
replace?: boolean
only?: string[]
except?: string[]
Expand Down Expand Up @@ -53,6 +54,7 @@ const Link = forwardRef<unknown, InertiaLinkProps>(
method = 'get',
preserveScroll = false,
preserveState = null,
preserveUrl = false,
replace = false,
only = [],
except = [],
Expand Down Expand Up @@ -88,6 +90,7 @@ const Link = forwardRef<unknown, InertiaLinkProps>(
method,
preserveScroll,
preserveState: preserveState ?? method !== 'get',
preserveUrl,
replace,
only,
except,
Expand Down

0 comments on commit cf60b3c

Please sign in to comment.