Skip to content

Commit

Permalink
Fix type of onClick for Link component in React (#1699)
Browse files Browse the repository at this point in the history
An `onClick` in React — or event in the browser — never receives keyboard events. Even for a button that is “clicked” using enter or spacebar the browser creates a corresponding pointer event for the action that is passed into `onClick`.
  • Loading branch information
thecrypticace authored Oct 6, 2023
1 parent a650a37 commit 2595fa3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react/src/Link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface BaseInertiaLinkProps {
href: string
method?: Method
headers?: Record<string, string>
onClick?: (event: React.MouseEvent<HTMLAnchorElement> | React.KeyboardEvent<HTMLAnchorElement>) => void
onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void
preserveScroll?: PreserveStateOption
preserveState?: PreserveStateOption
replace?: boolean
Expand Down

0 comments on commit 2595fa3

Please sign in to comment.