Skip to content

LinkHandler

LinkHandler = (url, anchor, event) => boolean | void

Defined in: route.ts:679

A link handler, as optionally passed to interceptLinks: called for every local-link activation that passed the built-in exclusions, with the resolved URL, the anchor element the activation landed on, and the DOM event.

  • Return false to leave the link to the browser (no preventDefault).
  • Return true to claim the link: default handling is prevented and the handler is assumed to have navigated (or decided not to) itself.
  • Return nothing for the default: prevent and go(href).

URL

HTMLAnchorElement

Event

boolean | void