Class: Router
router.Router
Hierarchy
ReactantRouter
↳
Router
Constructors
constructor
• new Router(portDetector
, sharedAppOptions
, options
)
Parameters
Name | Type |
---|---|
portDetector | PortDetector |
sharedAppOptions | ISharedAppOptions |
options | IRouterOptions |
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
Name | Type |
---|---|
S | unknown |
Parameters
Name | Type |
---|---|
location | Location <S > |
action | Action |
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
Name | Type |
---|---|
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
Name | Type |
---|---|
name | string |
router | RouterState |
Returns
void
Defined in
packages/reactant-share/src/router.ts:231
_changeRoutingOnSever
▸ Protected
_changeRoutingOnSever(name
, router
): void
Parameters
Name | Type |
---|---|
name | string |
router | RouterState |
Returns
void
Defined in
packages/reactant-share/src/router.ts:209
_makeRoutingOnClient
▸ Protected
_makeRoutingOnClient(__namedParameters
): Promise
<unknown
>
Parameters
Name | Type |
---|---|
__namedParameters | Object |
__namedParameters.action | "replace" | "push" | "go" | "goBack" | "goForward" |
__namedParameters.args | any [] |
__namedParameters.name | string |
Returns
Promise
<unknown
>
Defined in
packages/reactant-share/src/router.ts:249
_setRouters
▸ Protected
_setRouters(name
, router
): void
Parameters
Name | Type |
---|---|
name | string |
router | RouterState |
Returns
void
Defined in
packages/reactant-share/src/router.ts:282
afterCombineRootReducers
▸ Optional
afterCombineRootReducers(rootReducer
): Reducer
<any
, AnyAction
>
As hook after combine rootReducers
Parameters
Name | Type |
---|---|
rootReducer | Reducer <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
Name | Type |
---|---|
store | Store <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
Name | Type |
---|---|
reducers | ReducersMapObject <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
Name | Type |
---|---|
router | RouterState |
Returns
void
Defined in
packages/reactant-share/src/router.ts:317
go
▸ go(n
): Promise
<void
>
Parameters
Name | Type |
---|---|
n | number |
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
Name | Type |
---|---|
preloadedState | Object |
Returns
Object
Inherited from
BaseReactantRouter.preloadedStateHandler
Defined in
packages/reactant-module/src/core/plugin.ts:20
provider
▸ provider(props
): any
Parameters
Name | Type |
---|---|
props | any |
Returns
any
Inherited from
BaseReactantRouter.provider
Defined in
packages/reactant-router/src/router.tsx:135
push
▸ push(path
, locationState?
): Promise
<void
>
Parameters
Name | Type |
---|---|
path | string |
locationState? | unknown |
Returns
Promise
<void
>
Overrides
BaseReactantRouter.push
Defined in
packages/reactant-share/src/router.ts:327
replace
▸ replace(path
, locationState?
): Promise
<void
>
Parameters
Name | Type |
---|---|
path | string |
locationState? | unknown |
Returns
Promise
<void
>
Overrides
BaseReactantRouter.replace
Defined in
packages/reactant-share/src/router.ts:346
watchRehydratedRouting
▸ watchRehydratedRouting(): Unsubscribe
Returns
Unsubscribe