Class: Router
Hierarchy
PluginModule↳
Router
Constructors
constructor
• new Router(options)
Parameters
| Name | Type |
|---|---|
options | IRouterOptions |
Overrides
PluginModule.constructor
Defined in
packages/reactant-router/src/router.tsx:62
Properties
ConnectedRouter
• ConnectedRouter: FunctionComponent<{}>
Defined in
packages/reactant-router/src/router.tsx:103
[storeKey]
• Optional Readonly [storeKey]: Store<any, AnyAction>
Inherited from
PluginModule.__@storeKey@117370
Defined in
packages/reactant-module/src/core/plugin.ts:15
autoCreateHistory
• autoCreateHistory: boolean
Defined in
packages/reactant-router/src/router.tsx:54
autoProvide
• autoProvide: boolean
Defined in
packages/reactant-router/src/router.tsx:50
defaultHistory
• Protected Optional defaultHistory: Object
Type declaration
| Name | Type |
|---|---|
action | string |
location | Location<unknown> |
Defined in
packages/reactant-router/src/router.tsx:98
enhancer
• Optional enhancer: Function
inject enhancer for Redux
Inherited from
PluginModule.enhancer
Defined in
packages/reactant-module/src/core/plugin.ts:32
history
• Protected history: History<unknown>
Defined in
packages/reactant-router/src/router.tsx:52
middleware
• Optional middleware: Middleware<{}, any, Dispatch<AnyAction>>
inject middleware for Redux
Inherited from
PluginModule.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>
Defined in
packages/reactant-router/src/router.tsx:56
options
• Protected options: IRouterOptions
Defined in
packages/reactant-router/src/router.tsx:62
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>]> |
Defined in
packages/reactant-router/src/router.tsx:58
stateKey
• Protected Readonly stateKey: "router"
Defined in
packages/reactant-router/src/router.tsx:60
Accessors
currentPath
• get currentPath(): undefined | string
Returns
undefined | string
Defined in
packages/reactant-router/src/router.tsx:111
router
• get router(): undefined | RouterState
Returns
undefined | RouterState
Defined in
packages/reactant-router/src/router.tsx:107
store
• get store(): undefined | Store<any, AnyAction>
Returns
undefined | Store<any, AnyAction>
Defined in
packages/reactant-router/src/router.tsx:83
Methods
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
PluginModule.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
PluginModule.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>>
Overrides
PluginModule.beforeCombineRootReducers
Defined in
packages/reactant-router/src/router.tsx:87
go
▸ go(n): void
Parameters
| Name | Type |
|---|---|
n | number |
Returns
void
Defined in
packages/reactant-router/src/router.tsx:123
goBack
▸ goBack(): void
Returns
void
Defined in
packages/reactant-router/src/router.tsx:127
goForward
▸ goForward(): void
Returns
void
Defined in
packages/reactant-router/src/router.tsx:131
preloadedStateHandler
▸ Optional preloadedStateHandler(preloadedState): Object
preloaded state handler for Redux
Parameters
| Name | Type |
|---|---|
preloadedState | Object |
Returns
Object
Inherited from
PluginModule.preloadedStateHandler
Defined in
packages/reactant-module/src/core/plugin.ts:20
provider
▸ provider(props): any
Parameters
| Name | Type |
|---|---|
props | any |
Returns
any
Overrides
PluginModule.provider
Defined in
packages/reactant-router/src/router.tsx:135
push
▸ push(path, state?): void
Parameters
| Name | Type |
|---|---|
path | string |
state? | unknown |
Returns
void
Defined in
packages/reactant-router/src/router.tsx:115
replace
▸ replace(path, state?): void
Parameters
| Name | Type |
|---|---|
path | string |
state? | unknown |
Returns
void