Open sajTempler opened 3 years ago
You only need to create a router in the shared file, you don't need to wrap it in a store. The router already loads its state from a store so it's a global instance and you can push to the router you import in any component.
I had a use case from router v1 like this: https://github.com/ionic-team/stencil-router/wiki/Navigating-Programmatically
and in v2 I didn't see any recommendation so here is what I can up with:
using stencil store I have a router initialized there as
readonly
property:for app-root definitions:
and finally in other components I can call navigation from JS like:
Is there better approach ? Cheers ;)