router
router copied to clipboard
There should be a non-static `go` method
When you navigate to another view by looking up the URL, you need to have the router instance. To be able to navigate to another view, you need to have the Router class. So unless I misunderstand something you cannot do
import { router } from './my-app.js';
...
router.go(router.urlForName('users-view'));
but instead you must do
import { router } from './my-app.js';
import { Router } from '@vaadin/router';
...
Router.go(router.urlForName('users-view'));
Workaround: router.constructor.go(router.urlForName('users-view'));
Any update on this?
Agree!
+1