Skip to content

Commit 095af15

Browse files
authored
added some history methods
1 parent d8d3c67 commit 095af15

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/router.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,15 @@ export default class Router extends React.Component<Props, State> {
112112
}
113113
}
114114
}
115+
goBack() {
116+
this.history.goBack();
117+
}
118+
goForward() {
119+
this.history.goForward();
120+
}
121+
go(n) {
122+
this.history.go(n);
123+
}
115124
private _locationChanged = async (location, action) => {
116125
try {
117126
const { path, route, status, params, redirect, result, ctx } = await this.router.run({ path: location.pathname });

0 commit comments

Comments
 (0)