% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/hooks.R
\name{useLinkClickHandler}
\alias{useLinkClickHandler}
\title{useLinkClickHandler}
\usage{
useLinkClickHandler(
  into = NULL,
  as = "children",
  render = NULL,
  to,
  replace = NULL,
  state = NULL,
  target = NULL,
  preventScrollReset = NULL,
  relative = NULL,
  ...
)
}
\arguments{
\item{into}{A component (HTML tag or \pkg{shiny.react}-based element)
that will receive the hook value as the specified prop.}

\item{as}{Character. The name of the component's prop to inject the hook
value into. Defaults to \code{"children"}.}

\item{render}{Optional \code{\link{JS}} function \code{(value) => ReactNode}
used in place of \code{into}/\code{as}.}

\item{to}{Character. Destination path.}

\item{replace}{Optional boolean. Replace the current entry in the history
stack instead of pushing a new one.}

\item{state}{Optional. State value to attach to the new location.}

\item{target}{Optional character. Anchor target (e.g. \code{"_blank"}).}

\item{preventScrollReset}{Optional boolean. If \code{TRUE}, do not reset
scroll position on navigation.}

\item{relative}{Optional character. Either \code{"route"} (default) or
\code{"path"}.}

\item{...}{Additional props to pass to the component.}
}
\description{
\url{https://api.reactrouter.com/v7/functions/react-router.useLinkClickHandler.html}
}
\details{
Calls the \code{useLinkClickHandler()} hook and exposes the returned click
handler function via \code{render} (or injects it \code{as} a prop of
\code{into}, e.g. \code{as = "onClick"}). Lets you build link-like
components that drive client-side navigation without using
\code{\link{Link}}.

Because the hook returns a function, the \code{render} form is the natural
fit:
\preformatted{
  useLinkClickHandler(
    to = "/about",
    render = JS("h => <span onClick={h} role='link'>About</span>")
  )
}
}
