Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
react-next-internal-link
Advanced tools
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.
The npm package react-next-internal-link receives a total of 0 weekly downloads. As such, react-next-internal-link popularity was classified as not popular.
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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.