react_router6.dom

Type members

Classlikes

@native @JSType
abstract
trait Action extends Any
Companion
object
object Action
Companion
class
case
object BuildInfo

This object was generated by sbt-buildinfo.

This object was generated by sbt-buildinfo.

object HashRouter
@native @JSType
trait History[S] extends Object
object Link
@JSType
@JSType
trait Location[S] extends Object

More specific types when returning from useLocation.

More specific types when returning from useLocation.

Companion
object
object Location
Companion
class
@JSType
trait LocationInit[S] extends LocationPieces[S]

Like Location but everything is optional.

Like Location but everything is optional.

Companion
object
Companion
class
@JSType
trait LocationPieces[S] extends PathPieces
object NavLink
object Navigate
@native @JSType
trait NavigateFunction extends Object
@JSType
trait NavigateOptions[S] extends Object
@native @JSType
trait Navigator[S] extends Object
object Outlet
@JSType
trait PartialRouteObject extends Object
@native @JSType
trait PathMatch extends Object
@JSType
trait PathPieces extends Object
object Prompt
@native @JSType
trait ResolvedLocation extends Object
object Route
@native @JSType
trait RouteObject extends Object
@JSType
trait RouteSpecElement extends Object

Very similar to what you provide to the Route component.

Very similar to what you provide to the Route component.

@JSType
trait RouteSpecRouteTo extends Object
object Router
object Routes
@native @JSType
trait Transition[S] extends Update[S]
@native @JSType
trait UnblockingTx extends Object
@native @JSType
trait Update[S] extends Object

Types

type Blocker[S] = Function1[Transition[S], Unit]
type Hash = String
type LocationKey = String
type Path = String
type Pathname = String
type RoutePreloadFunction[S] = Function3[Dictionary[String] | Object | Dynamic, Location[S], Int, Unit]
type Search = String
type To = Path | PathPieces
type URLSearchParamsInit = URLSearchParams | String | Array[Any] | Object

Value members

Concrete methods

@native @JSImport("react-router-dom", "createRoutesFromChildren")
@native @JSImport("react-router-dom", "createRoutesFromChildren")
def createRoutesFromChildren(children: UndefOr[Any]): Array[RouteObject]
@native @JSImport("react-router-dom", "createSearchParams")
def createSearchParams(init: URLSearchParamsInit): URLSearchParams
@native @JSImport("react-router-dom", "generatePath")
def generatePath(pathname: String, params: Dictionary[String] | Object): String
@native @JSImport("react-router-dom", "matchPath")
def matchPath(pattern: PathPattern, pathname: String): PathMatch | Null
@native @JSImport("react-router-dom", "matchRoutes")
def matchRoutes[S](routes: RouteSpec, location: Location[S] | String, basename: UndefOr[String], caseSensitive: UndefOr[Boolean]): Location[S] | Null
@native @JSImport("react-router-dom", "resolveLocation")
def resolveLocation[S](to: Location[S] | String, fromPathName: String): Location[S]
@native @JSImport("react-router", "resolvePath")
def resolvePath(to: To, fromPathname: UndefOr[String]): PathPieces
@native @JSImport("react-router-dom", "useBlocker")
def useBlocker[S](blocker: Blocker[S], when: UndefOr[Boolean]): Unit
@native @JSImport("react-router-dom", "useHref")
def useHref[S](to: To): String
@native @JSImport("react-router-dom", "useInRouterContext")
def useInRouterContext(): Boolean
@native @JSImport("react-router-dom", "useLinkClickHandler")
def useLinkClickHandler(to: To, context: UndefOr[LinkClickHandlerOptions[_]]): Function0[Unit]
@native @JSImport("react-router-dom", "useLocation")
def useLocation[S](): Location[S]

Should not need to use this according to docs.

Should not need to use this according to docs.

@native @JSImport("react-router-dom", "useLocationPending")
def useLocationPending(): Boolean
@native @JSImport("react-router-dom", "useMatch")
def useMatch(to: PathPattern): PathMatch | Null

Use this to avoid Route entries everywhere.

Use this to avoid Route entries everywhere.

@native @JSImport("react-router-dom", "useNavigate")
@native @JSImport("react-router-dom", "useOutlet")
def useOutlet(): ReactNode
@native @JSImport("react-router-dom", "useOutletContext")
def useOutletContext(): Unit
@native @JSImport("react-router-dom", "useParams")
def useParams[P <: Object](): P
@native @JSImport("react-router-dom", "uesParams")
def useParamsDict(): Dictionary[String]
@native @JSImport("react-router-dom", "usePrompt")
def usePrompt(message: String, when: UndefOr[Boolean]): Unit
@native @JSImport("react-router-dom", "useResolvedPath")
@native @JSImport("react-router-dom", "useRoutes")
def useRoutes(routes: Array[PartialRouteObject], basename: UndefOr[String]): ReactNode
@native @JSImport("react-router-dom", "useSearchParams")
def useSearchParams(init: UndefOr[URLSearchParamsInit]): URLSearchParams