Closed mocheng closed 6 years ago
Use routes.Router
to get the Router instance.
getRouter
is used only internally to wrap the original Router
@fridays Still not working even with prefetchRoute()
too 🤔
I've tried to get the prefetchRoute()
method to work as well as following.
// pattern with params
const Component = await Router.prefetchRoute('/:slug', { slug: 'slug' });
// name with params
const Component = await Router.prefetchRoute('name', { slug: 'slug' });
// final route
const Component = await Router.prefetchRoute('/slug');
But all without success. Any help or documentation would be much appreciated!
When prefetch with imperative API like this
It is expected to prefetch javascript URL in given
foo
page. However, it just directly prefetch-es/foo
. I suppose it should be able to detects which javascript URL without parsing/foo
page HTML.