Socket
Socket
Sign inDemoInstall

link-react

Package Overview
Dependencies
3
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    link-react

A generalized link component that allows client-side navigation while taking into account exceptions.


Version published
Weekly downloads
523
increased by96.62%
Maintainers
1
Install size
120 kB
Created
Weekly downloads
 

Readme

Source

A generalized link <a> component that allows client-side navigation, while ignoring:

  • shift-clicking
  • alt-clicking
  • ctrl-clicking
  • non-left clicking
  • target attribute
  • mailto href

Install

npm install link-react --save

React itself is a peer dependency and not included, it is the responsibility of the implementing app to provide a reference to React.

Use

import React from 'react';
import Link from 'link-react';

export default (p) => (
	<nav>
		<Link href={ p.homeLink.href } onClick={ p.homeLink.onClick }>{ p.homeLink.label }</Link>
		<Link href={ p.aboutLink.href } onClick={ p.aboutLink.onClick }>{ p.aboutLink.label }</Link>
	</nav>
);

License

Released under an MIT license.

  • state-driven routing: Full-featured, dependency-free, dsl-free, state-driven routing.

Other

Like it? Star It

Keywords

FAQs

Last updated on 22 Nov 2016

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc