Closed jasongrishkoff closed 2 years ago
Hello @jasongrishkoff ,
Sorry for the late reply, missed this one. As of right now there's no way to dynamically create new routes during runtime.
I guess we should consider it as a feature for next major release.
@jasongrishkoff this won't fix at the moment (I'm planing to rewrite this package from ground zero for the past three years, unless this happens, there's no way to implement dynamic routes within the current codebase), duplicates #76
Hi there, I've got one big
router.js
file that has a whole bunch of routes inside it. For example:I've got 100+ such routes in this file -- many of which are only relevant for certain users (such as an admin).
Is there a way to dynamically import that route, but ONLY if the user is an admin? It's easy enough to dynamically import a file containing all the admin routes, but unless I provide the route as part of the main package bundle, the admin page I'm trying to visit will result in a 404.
Appreciate any guidance!
J