Skip to content

Commit 5fd1ea4

Browse files
authored
add ctx to push method
1 parent 8a3eac5 commit 5fd1ea4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/browser-router.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ export default class BrowserRouter extends Router {
5050
if (error.message !== 'Cancelled') this.history.push(path);
5151
}
5252
}
53-
async push(path) {
53+
async push(path, ctx = new Context()) {
5454
// console.warn('Please use navigate method instead of push, it will be deprecated in future');
5555
if (typeof path === 'string') {
56-
await this.navigate(path);
56+
await this.navigate(path, ctx);
5757
} else {
5858
let fullPath = path.pathname;
5959
if (path.query) fullPath += `?${stringifyQuery(path.query)}`;
60-
await this.navigate(fullPath);
60+
await this.navigate(fullPath, ctx);
6161
}
6262
}
6363
// TODO: maybe we need to make this history methods works through navigate?
@@ -113,4 +113,4 @@ export default class BrowserRouter extends Router {
113113
</div>
114114
)
115115
}
116-
}
116+
}

0 commit comments

Comments
 (0)