diff --git a/src/router/index.ts b/src/router/index.ts index 4a45c994..c06e3cf3 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -12,20 +12,24 @@ import { routes } from './routes'; const router = new Router(); -router.setRoutes([ - // Redirect to URL without trailing slash - { - path: '(.*)/', - action: (context, commands) => { - const newPath = context.pathname.slice(0, -1); - return commands.redirect(newPath); - } - }, - ...routes -]); +router.setRoutes( + [ + // Redirect to URL without trailing slash + { + path: '(.*)/', + action: (context, commands) => { + const newPath = context.pathname.slice(0, -1); + return commands.redirect(newPath); + } + }, + ...routes + ], + true +); export const attachRouter = (outlet: HTMLElement) => { router.setOutlet(outlet); + router.render(window.location, true); }; export const urlForName = (name: string, params?: Params) => {