Skip to content

Commit 8c7e9aa

Browse files
authored
fix: Remove "to" prop if component is <a> (#3654)
1 parent 248756d commit 8c7e9aa

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/shared/AppLink/AppLink.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ function useCompleteProps(
3333

3434
const propsLink = pageConfig?.isExternalLink
3535
? { href: path }
36-
: Component === 'a'
37-
? { href: path }
38-
: { to: path || '/' }
36+
: { to: path || '/' }
3937

4038
const propsTarget = pageConfig?.openNewTab ? { target: '_blank' } : {}
4139
const propsActive = Component === NavLink ? { activeClassName } : {}
@@ -45,6 +43,7 @@ function useCompleteProps(
4543
...propsTarget,
4644
...props,
4745
...propsActive,
46+
...(Component === 'a' && { to: undefined }),
4847
}
4948
}
5049

0 commit comments

Comments
 (0)