Skip to main content

Class: Router

router.Router

Hierarchy

  • ReactantRouter

    Router

Constructors

constructor

new Router(portDetector, sharedAppOptions, options)

Parameters

NameType
portDetectorPortDetector
sharedAppOptionsISharedAppOptions
optionsIRouterOptions

Overrides

BaseReactantRouter.constructor

Defined in

packages/reactant-share/src/router.ts:48

Properties

ConnectedRouter

ConnectedRouter: FunctionComponent<{}>

Inherited from

BaseReactantRouter.ConnectedRouter

Defined in

packages/reactant-router/src/router.tsx:103


[storeKey]

Optional Readonly [storeKey]: Store<any, AnyAction>

Inherited from

BaseReactantRouter.__@storeKey@153774

Defined in

packages/reactant-module/src/core/plugin.ts:15


_routers

Protected _routers: Record<string, undefined | RouterState>

Defined in

packages/reactant-share/src/router.ts:278


autoCreateHistory

autoCreateHistory: boolean

Inherited from

BaseReactantRouter.autoCreateHistory

Defined in

packages/reactant-router/src/router.tsx:54


autoProvide

autoProvide: boolean

Inherited from

BaseReactantRouter.autoProvide

Defined in

packages/reactant-router/src/router.tsx:50


defaultHistory

Protected defaultHistory: RouterState

Overrides

BaseReactantRouter.defaultHistory

Defined in

packages/reactant-share/src/router.ts:307


enhancer

Optional enhancer: Function

inject enhancer for Redux

Inherited from

BaseReactantRouter.enhancer

Defined in

packages/reactant-module/src/core/plugin.ts:32


history

Protected history: History<unknown>

Inherited from

BaseReactantRouter.history

Defined in

packages/reactant-router/src/router.tsx:52


middleware

Optional middleware: Middleware<{}, any, Dispatch<AnyAction>>

inject middleware for Redux

Inherited from

BaseReactantRouter.middleware

Defined in

packages/reactant-module/src/core/plugin.ts:27


onLocationChanged

onLocationChanged: <S>(location: Location<S>, action: Action, isFirstRendering?: boolean) => LocationChangeAction<S> = onLocationChanged

Type declaration

▸ <S>(location, action, isFirstRendering?): LocationChangeAction<S>

Type parameters
NameType
Sunknown
Parameters
NameType
locationLocation<S>
actionAction
isFirstRendering?boolean
Returns

LocationChangeAction<S>

Inherited from

BaseReactantRouter.onLocationChanged

Defined in

packages/reactant-router/src/router.tsx:56


options

Protected options: IRouterOptions

Inherited from

BaseReactantRouter.options

Defined in

packages/reactant-share/src/router.ts:51


portDetector

Protected portDetector: PortDetector

Defined in

packages/reactant-share/src/router.ts:49


routerActions

routerActions: Object = routerActions

Type declaration

NameType
go(n: number) => CallHistoryMethodAction<[number]>
goBack() => CallHistoryMethodAction<[]>
goForward() => CallHistoryMethodAction<[]>
push<S>(path: string, state?: S) => CallHistoryMethodAction<[Path, S?]><S>(location: LocationDescriptorObject<S>) => CallHistoryMethodAction<[LocationDescriptorObject<S>]>
replace<S>(path: string, state?: S) => CallHistoryMethodAction<[Path, S?]><S>(location: LocationDescriptorObject<S>) => CallHistoryMethodAction<[LocationDescriptorObject<S>]>

Inherited from

BaseReactantRouter.routerActions

Defined in

packages/reactant-router/src/router.tsx:58


sharedAppOptions

Protected sharedAppOptions: ISharedAppOptions

Defined in

packages/reactant-share/src/router.ts:50


stateKey

Protected Readonly stateKey: "router"

Inherited from

BaseReactantRouter.stateKey

Defined in

packages/reactant-router/src/router.tsx:60


toBeRouted

toBeRouted: null | () => void = null

Defined in

packages/reactant-share/src/router.ts:275

Accessors

currentPath

get currentPath(): string

Returns

string

Overrides

BaseReactantRouter.currentPath

Defined in

packages/reactant-share/src/router.ts:323


defaultRoute

Protected get defaultRoute(): string

Returns

string

Defined in

packages/reactant-share/src/router.ts:293


enableCacheRouting

Protected get enableCacheRouting(): any

Returns

any

Defined in

packages/reactant-share/src/router.ts:297


router

get router(): undefined | RouterState

Returns

undefined | RouterState

Inherited from

BaseReactantRouter.router

Defined in

packages/reactant-router/src/router.tsx:107


store

get store(): undefined | Store<any, AnyAction>

Returns

undefined | Store<any, AnyAction>

Inherited from

BaseReactantRouter.store

Defined in

packages/reactant-router/src/router.tsx:83

Methods

_changeRoutingOnClient

Protected _changeRoutingOnClient(name, router): void

Parameters

NameType
namestring
routerRouterState

Returns

void

Defined in

packages/reactant-share/src/router.ts:231


_changeRoutingOnSever

Protected _changeRoutingOnSever(name, router): void

Parameters

NameType
namestring
routerRouterState

Returns

void

Defined in

packages/reactant-share/src/router.ts:209


_makeRoutingOnClient

Protected _makeRoutingOnClient(__namedParameters): Promise<unknown>

Parameters

NameType
__namedParametersObject
__namedParameters.action"replace" | "push" | "go" | "goBack" | "goForward"
__namedParameters.argsany[]
__namedParameters.namestring

Returns

Promise<unknown>

Defined in

packages/reactant-share/src/router.ts:249


_setRouters

Protected _setRouters(name, router): void

Parameters

NameType
namestring
routerRouterState

Returns

void

Defined in

packages/reactant-share/src/router.ts:282


afterCombineRootReducers

Optional afterCombineRootReducers(rootReducer): Reducer<any, AnyAction>

As hook after combine rootReducers

Parameters

NameType
rootReducerReducer<any, AnyAction>

Returns

Reducer<any, AnyAction>

Inherited from

BaseReactantRouter.afterCombineRootReducers

Defined in

packages/reactant-module/src/core/plugin.ts:47


afterCreateStore

Optional afterCreateStore(store): Store<any, AnyAction>

As hook after createStore

Parameters

NameType
storeStore<any, AnyAction>

Returns

Store<any, AnyAction>

Inherited from

BaseReactantRouter.afterCreateStore

Defined in

packages/reactant-module/src/core/plugin.ts:37


beforeCombineRootReducers

beforeCombineRootReducers(reducers): ReducersMapObject<any, Action<any>>

Parameters

NameType
reducersReducersMapObject<any, Action<any>>

Returns

ReducersMapObject<any, Action<any>>

Inherited from

BaseReactantRouter.beforeCombineRootReducers

Defined in

packages/reactant-router/src/router.tsx:87


dispatchChanged

Protected dispatchChanged(router): void

Parameters

NameType
routerRouterState

Returns

void

Defined in

packages/reactant-share/src/router.ts:317


go

go(n): Promise<void>

Parameters

NameType
nnumber

Returns

Promise<void>

Overrides

BaseReactantRouter.go

Defined in

packages/reactant-share/src/router.ts:365


goBack

goBack(): Promise<void>

Returns

Promise<void>

Overrides

BaseReactantRouter.goBack

Defined in

packages/reactant-share/src/router.ts:384


goForward

goForward(): Promise<void>

Returns

Promise<void>

Overrides

BaseReactantRouter.goForward

Defined in

packages/reactant-share/src/router.ts:403


preloadedStateHandler

Optional preloadedStateHandler(preloadedState): Object

preloaded state handler for Redux

Parameters

NameType
preloadedStateObject

Returns

Object

Inherited from

BaseReactantRouter.preloadedStateHandler

Defined in

packages/reactant-module/src/core/plugin.ts:20


provider

provider(props): any

Parameters

NameType
propsany

Returns

any

Inherited from

BaseReactantRouter.provider

Defined in

packages/reactant-router/src/router.tsx:135


push

push(path, locationState?): Promise<void>

Parameters

NameType
pathstring
locationState?unknown

Returns

Promise<void>

Overrides

BaseReactantRouter.push

Defined in

packages/reactant-share/src/router.ts:327


replace

replace(path, locationState?): Promise<void>

Parameters

NameType
pathstring
locationState?unknown

Returns

Promise<void>

Overrides

BaseReactantRouter.replace

Defined in

packages/reactant-share/src/router.ts:346


watchRehydratedRouting

watchRehydratedRouting(): Unsubscribe

Returns

Unsubscribe

Defined in

packages/reactant-share/src/router.ts:191