Skip to main content
Module

x/ruck/useOnClickRouteLink.mjs>default

Ruck is an open source buildless React web application framework for Deno.
Latest
function default
import { default } from "https://deno.land/x/ruck@v8.0.1/useOnClickRouteLink.mjs";

A React hook to use a click event handler for an a element that has a Ruck app route href, for client side navigation instead of the browser default full page load. The handler doesn’t do anything if the event default action is already prevented, if a non main mouse button was pressed, or if any of the following keys were pressed during the click:

  • Alt (in Safari, downloads the link)
  • Control (in Safari, displays the link context menu)
  • Meta (in Safari, opens the link in a new tab)
  • Shift (in Safari, adds the link to Reading List)