Skip to content

Commit 098da68

Browse files
committed
[fix] History object missing in Router component
1 parent 46c0614 commit 098da68

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
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": "cell-router",
3-
"version": "4.0.0",
3+
"version": "4.0.1",
44
"license": "LGPL-3.0",
55
"description": "Web Component Router based on WebCell & MobX",
66
"keywords": [

source/Router.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,12 @@ export class CellRouter
6666
if (routes[0]) this.routes = routes;
6767
};
6868

69-
@reaction(({ history }) => history.path)
69+
@reaction(({ history }) => history?.path)
7070
async renderChildren() {
7171
const { history, routes } = this;
72+
73+
if (!history) return;
74+
7275
const { path } = history;
7376
const [{ component: Tag, ...matched } = {}] = [...routes]
7477
.sort(

0 commit comments

Comments
 (0)