Themes

Router/Types/RouteRenderProps
RouteRenderProps

Automatically passed to children of Routes and from routeRender prop.

Name
Description
Type
history

The router history. (same as router.history).

RouterHistory
match

The match params of the parent Route's path.

MatchResults

RouterHistory

Name
Description
Type
action

The previously applied action. ("PUSH", "POP", "REPLACE")

string
block
(prompt: string | Prompt ) => () => void
createHref
(location: LocationSegments ) => string
go
(delta: number ) => void
goBack
() => void
goForward
() => void
length

Returns an Integer representing the number of elements in the session history, including the currently loaded page.

number
listen
(listener: Listener ) => () => void
location

The current location.

LocationSegments
push
(path: string | LocationSegments state: any updateScroll: boolean ) => void
replace
(path: string | LocationSegments state: any updateScroll: boolean ) => void
win

The window that this history is attached to.

Window

Prompt

Prompt = (location: LocationSegments action: string ) => string

LocationSegments

Name
Description
Type
hash

The current hash.

string
key

The key of the location.

string
pathname

The path from root.

string
query

The contents of the search params.

Record<string, any>
scrollPosition

A tuple of [x, y] scroll position.

[number, number]
search

The current search string.

string
state

Any state that has been attached to the current location.

any

Listener

Listener = (location: LocationSegments action: string ) => void

MatchResults

Name
Description
Type
isExact

If the match was done with exact matching.

boolean
params

The params that were extracted from the url.

Record<string, string>
path

The path matcher this was matched against.

Path
url

The url that was passed to the matcher.

string

Path

Path = string | RegExp | string | RegExp[]