![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@nx/next-router
Advanced tools
A routing library for Next.js
npm install @nx/next-router
This library is inspired by and works very similar than next-routes. It works with a custom server or with Next.js 9 file system routing.
Create a file like routes.config.(ts|js)
and paste the following:
import { Router, Routes, Link } from '@nx/next-router';
const routes: Routes = {
'user': {
pattern: '/user',
page: '/user',
},
'home': {
pattern: '/',
page: '/index',
}
};
const router = new Router(routes);
const link = Link(router);
export { router as Router };
export { link as Link };
We look at one root defininion:
'user': { // This is the route name
pattern: '/user', // This is the url pattern to call the page
page: '/user', // This is the next page (pages/user.js or pages/user/index.js)
},
The pattern can be anything that path-to-regexp understands.
So a route with an optional parameter would be /user/:name?
for example.
path-to-regexp by the way is the same library that express is using for the routing.
You can use the exported Link component instead of the next/link.
// /user pattern
<Link route="user">
<a>Got to User page</a>
</Link>
// /user/:name pattern
<Link route="user" params={{ name: 'stefan' }}>
<a>Got to User detail page</a>
</Link>
FAQs
A routing library for Next.js
The npm package @nx/next-router receives a total of 0 weekly downloads. As such, @nx/next-router popularity was classified as not popular.
We found that @nx/next-router demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.