Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
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.
react-external-link
Advanced tools
[![Build Status](https://img.shields.io/github/actions/workflow/status/acelaya/react-external-link/ci.yml?branch=main&logo=github&style=flat-square)](https://github.com/acelaya/react-external-link/actions/workflows/ci.yml) [![Code Coverage](https://img.sh
This library provides a simple ExternalLink
component for react which can be used to render a
tags with both target="_blank"
and rel="noopener noreferrer"
attributes.
npm install react-external-link --save
If you just need a simple link with no custom text:
import { ExternalLink } from 'react-external-link';
const MyComponent = () => (
<div>
<ExternalLink href="https://example.com" />
</div>
);
export default MyComponent;
This will be rendered as:
<a href="https://example.com" target="_blank" rel="noopener noreferrer">https://example.com</a>
If you need to provide a custom content, you can do so by providing the ExternalLink
's children
:
import { ExternalLink } from 'react-external-link';
const MyComponent = () => (
<div>
<ExternalLink href="https://example.com">
<span>Visit the site</span>
</ExternalLink>
</div>
);
export default MyComponent;
This will be rendered as:
<a href="https://example.com" target="_blank" rel="noopener noreferrer">
<span>Visit the site</span>
</a>
It is also possible to pass any extra props, and they will be propagated to the link:
import { ExternalLink } from 'react-external-link';
const MyComponent = () => <ExternalLink href="https://example.com" className="my-class" />;
export default MyComponent;
The result in this case will be:
<a href="https://example.com" target="_blank" rel="noopener noreferrer" class="my-class">https://example.com</a>
[2.4.0] - 2024-12-06
@shlinkio/eslint-config-js-coding-standard
3.0, and migrate to ESLint flat config.FAQs
[![Build Status](https://img.shields.io/github/actions/workflow/status/acelaya/react-external-link/ci.yml?branch=main&logo=github&style=flat-square)](https://github.com/acelaya/react-external-link/actions/workflows/ci.yml) [![Code Coverage](https://img.sh
The npm package react-external-link receives a total of 642 weekly downloads. As such, react-external-link popularity was classified as not popular.
We found that react-external-link demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
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.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.