Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
react-next-internal-link
Advanced tools
A helper component to easily create internal, relative links from absolute urls in your NextJS React apps.
A helper component to easily create internal, relative links from absolute urls in your NextJS React apps.
npm install --save react-next-internal-link
Import as "InternalLink" and use as illustrated in the examples below. See the tests for examples of more advanced usages.
import React, { Component } from "react";
import InternalLink from "react-next-internal-link";
class Example extends Component {
render() {
return (
<div>
<h1>Example uses:</h1>
<div>
<h2>Example 1:</h2>
<p>Convert absolute url to internal, relative url</p>
<InternalLink
href="collection?id=abc123"
as="http://example.com/collection/abc123"
>
<a className="u-textColorGreen">Visit collection abc123</a>
</InternalLink>
<div>
<h3>The result of this example is:</h3>
<a href="/collection/abc" className="u-textColorGreen">
Visit collection abc123
</a>
</div>
</div>
<div>
<h2>Example 2:</h2>
<p>
It still works with urls that have a port, query string, and/or hash
fragment
</p>
<InternalLink
href="collection?id=abc123"
as="http://example.com:3100/collection/abc123?user=userA&show=true#div=pricing"
className="u-textColorGreen"
>
<a className="u-textColorGreen">Visit collection abc123</a>
</InternalLink>
<div>
<h3>The result of this example is:</h3>
<a
href="/collection/abc?user=userA&show=true#div=pricing"
className="u-textColorGreen"
>
Visit collection abc123
</a>
</div>
</div>
</div>
);
}
}
npm run test
MIT © Lwdthe1
FAQs
A helper component to easily create internal, relative links from absolute urls in your NextJS React apps.
We found that react-next-internal-link demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.