Skip to content

Commit

Permalink
fix(preact): fix Link.onClick event not fired
Browse files Browse the repository at this point in the history
  • Loading branch information
jrson83 committed May 7, 2024
1 parent 29d158d commit b0123b6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/preact/src/Link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,8 @@ const Link = forwardRef<unknown, InertiaLinkProps>(
ref
) => {
const visit = useCallback(
(event: MouseEvent | KeyboardEvent) => {
if (event instanceof MouseEvent) {
onClick(event)
}
(event: MouseEvent) => {
onClick(event)

if (shouldIntercept(event)) {
event.preventDefault()
Expand Down

0 comments on commit b0123b6

Please sign in to comment.