Suggest to have `Link` and `Router` to be accessed by singleton
See original GitHub issueI found that next-routes
API is not friendly.
In next.js
, each component could just depend on next/link
. So, component can reside in a standalone repo and published as npm package. However, when utilizing next-routes
, I have to import Link
from routes.js
file specific to given application. As a result, there is no way to create a standalone component to be shared.
import {Link} from 'path/to/routes';
How about making Link
and Router
accessible by singleton object in next-routes
? Like this
import {Link} from 'next-routes/link';
import {Router} from 'next-routes/router';
Internally, when next-routes
is executed to create instance, the instance is saved as singleton to be exposed by next-routes/link
and next-routes/router
.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:16
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Suggest to have `Link` and `Router` to be accessed by singleton
I found that next-routes API is not friendly. In next.js , each component could just depend on next/link . So, component can reside...
Read more >URLs and Routing
How to define client and server routes for your app using Flow Router. How to have your app display different content depending on...
Read more >Singleton services
There are two ways to make a service a singleton in Angular: ... has a Router and the root application components can access...
Read more >How to make Angular2 Service singleton?
I'm trying to implement an auth guard in my app. ie; Only authenticated users can access certain routes ...
Read more >In-app navigation: routing to views - Angular
To use the Angular router, an app needs to have at least two components so that it can navigate from one to ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for your suggestion. It totally makes sense, I’ll look into it!
Is anyone still working on this? I’d love to have this.