% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RouterProvider.R
\name{RouterProvider}
\alias{RouterProvider}
\title{RouterProvider}
\usage{
RouterProvider(router, fallbackElement = NULL)
}
\arguments{
\item{router}{A router element produced by \code{\link{createHashRouter}},
\code{\link{createBrowserRouter}}, or \code{\link{createMemoryRouter}}.}

\item{fallbackElement}{Element shown while the initial route's loader is
resolving.}
}
\value{
A RouterProvider component.
}
\description{
\url{https://api.reactrouter.com/v7/functions/react-router.RouterProvider.html}
}
\details{
Renders a data router. Mirrors the React Router v7 composition pattern:
pass a router built with \code{\link{createHashRouter}},
\code{\link{createBrowserRouter}}, or \code{\link{createMemoryRouter}} to
the \code{router} argument.

The underlying router is created once on mount and is not rebuilt when
\code{Route()} children change at runtime — React Router data routers own
their own navigation state and must be stable. To swap the route tree
dynamically (e.g. based on Shiny inputs), remount \code{RouterProvider}
itself, for instance by toggling its parent via \code{shiny::renderUI}.
}
