% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/hooks.R
\name{useRoutes}
\alias{useRoutes}
\title{useRoutes}
\usage{
useRoutes(..., routes = NULL)
}
\arguments{
\item{...}{\code{\link{Route}} elements describing the route tree.
Ignored if \code{routes} is supplied.}

\item{routes}{Optional. A \code{\link{JS}} expression evaluating to a plain
JavaScript array of route objects (e.g. \code{JS("[\{ path: '/', element: ... \}]")}),
used in place of \code{Route()} children.}
}
\description{
\url{https://api.reactrouter.com/v7/functions/react-router.useRoutes.html}
}
\details{
Builds a route tree from \code{\link{Route}} children (or a plain object
\code{routes} array) and renders the matched route. The hook-based
equivalent of \code{\link{Routes}} / \code{createRoutesFromElements} for
code that prefers a configuration-as-data style. Must be called inside a
router (\code{\link{RouterProvider}}, \code{\link{HashRouter}}, etc.).
}
