Skip to content

Commit 18f44a1

Browse files
committed
Added options helpers
1 parent 8d4a014 commit 18f44a1

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-router-async",
3-
"version": "0.6.38",
3+
"version": "0.6.39",
44
"author": {
55
"name": "Oleg Martynov",
66
"email": "[email protected]"

src/router.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ export interface initParams {
3838
history?: any,
3939
ctx: any,
4040
errors: any,
41-
isUniversal: boolean
41+
isUniversal: boolean,
42+
helpers?: any
4243
}
4344
export interface initResult {
4445
Router?: any,
@@ -74,14 +75,14 @@ export default class Router extends React.Component<Props, State> {
7475
this.subscriber = null;
7576
}
7677
static async init(opts: initParams): Promise<initResult> {
77-
const { path, routes, hooks, history = null, ctx = new Context(), errors, isUniversal } = opts;
78+
const { path, routes, hooks, history = null, ctx = new Context(), errors, isUniversal, helpers } = opts;
7879
let plainRoutes;
7980
if ((Array.isArray(routes) && React.isValidElement(routes[0])) || React.isValidElement(routes)) {
8081
plainRoutes = Router.buildRoutes(routes);
8182
} else {
8283
plainRoutes = routes;
8384
}
84-
const router = new RouterAsync({ routes: plainRoutes, hooks });
85+
const router = new RouterAsync({ routes: plainRoutes, hooks, helpers });
8586

8687
let routerResult: any = {};
8788
let callback = () => { /* noop */ };

0 commit comments

Comments
 (0)