Skip to content

Commit

Permalink
explicitly remove to prop if component is A
Browse files Browse the repository at this point in the history
  • Loading branch information
ajay-sentry committed Jan 13, 2025
1 parent 248756d commit fee30dd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/shared/AppLink/AppLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ function useCompleteProps(

const propsLink = pageConfig?.isExternalLink
? { href: path }
: Component === 'a'
? { href: path }
: { to: path || '/' }
: { to: path || '/' }

const propsTarget = pageConfig?.openNewTab ? { target: '_blank' } : {}
const propsActive = Component === NavLink ? { activeClassName } : {}
Expand All @@ -45,6 +43,7 @@ function useCompleteProps(
...propsTarget,
...props,
...propsActive,
...(Component === 'a' && { to: undefined }),
}
}

Expand Down

0 comments on commit fee30dd

Please sign in to comment.