Skip to main content

ReactRouter

Properties

(Mandatory properties are in bold)
PropertiesTypeDescription
backback(delta: number): void
constructornew ReactRouter()
deleteOrigindeleteOrigin(): void
forwardforward(delta: number): void
getLinkComponentgetLinkComponent(props: LinkProps,ref: null | MutableRefObject<null | HTMLAnchorElement> | ): Element
getOrigingetOrigin():
hash
historyLocation[]
href
i18nI18n
initinit(settings: AppSettings): void
listenlisten(callback: LocationChangeCallback): UnregisterCallbackcallback(url) where url is:

{
url: string, // example: /users/1?test=1&test2#h=3&h2
route: string, // example: /users/[id]
pathname: string, // example: /users/1
query: obj, // example: {test:1,test2:null}
hash: obj // example: {h:3, h2:null}
state: obj // example: {key1: 'value1'}
} | | location | | | | onLocationChange | onLocationChange(): void | | | params | AnonymousObject<any> | | | pathname | | | | previousLocation | | | | push | push(urlOrLocation: string | Location,options: RouterPushOptions): void | url can be a string or an object.
If object, the format is the following
{
url: string, // example: /users/1?test=1&test2#h=3&h2
route: string, // example: /users/[id]
pathname: string, // example: /users/1
query: obj, // example: {test:1,test2:null}
hash: obj // example: {h:3, h2:null}
state: obj // example: {key1: 'value1'}
} | | query | | | | replace | replace(urlOrLocation: string | Location,options: RouterPushOptions): void | | | saveOrigin | saveOrigin(force: boolean): void | | | settings | AppSettings | | | state | | | | sync | sync(location: Location,navigate: NavigateFunction,i18n: I18n,settings: AppSettings): void | | | listeners | LocationChangeCallback[] | Defaults to: [] |

Additional properties for advanced use cases
PropertiesTypeDescription
navigateNavigateFunction
routestring