From 25a6390e55e7d568eabdac15fe77fc36a682b33c Mon Sep 17 00:00:00 2001 From: "wanying.jwy" Date: Sun, 30 Aug 2020 17:54:44 +0800 Subject: [PATCH] fix: history.listen({location}) => history.listen(location) --- packages/rax-simulator-renderer/src/rax-use-router.js | 2 +- packages/rax-simulator-renderer/src/renderer.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/rax-simulator-renderer/src/rax-use-router.js b/packages/rax-simulator-renderer/src/rax-use-router.js index 2bd395315..d11c79279 100644 --- a/packages/rax-simulator-renderer/src/rax-use-router.js +++ b/packages/rax-simulator-renderer/src/rax-use-router.js @@ -243,7 +243,7 @@ export function useRouter(routerConfig) { matchLocation(history.location); } - unlisten = history.listen(({ location }) => { + unlisten = history.listen((location) => { matchLocation(location); }); diff --git a/packages/rax-simulator-renderer/src/renderer.ts b/packages/rax-simulator-renderer/src/renderer.ts index d25429d1e..df10fa7a0 100644 --- a/packages/rax-simulator-renderer/src/renderer.ts +++ b/packages/rax-simulator-renderer/src/renderer.ts @@ -288,7 +288,7 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer { initialEntries: [initialEntry], }); this.history = history; - history.listen(({ location }) => { + history.listen((location) => { host.project.open(location.pathname.substr(1)); }); host.componentsConsumer.consume(async (componentsAsset) => {