A generalized link <a>
component that allows client-side navigation, while ignoring:
- shift-clicking
- alt-clicking
- ctrl-clicking
- non-left clicking
target
attributemailto
href
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
.
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>
);
Released under an MIT license.
- state-driven routing: Full-featured, dependency-free, dsl-free, state-driven routing.
- extreme decoupling todo app: Example todo app of extreme decoupling of react, redux and selectors
- memoizerific: Fast, small, efficient JavaScript memoization to memoize JS functions
Like it? Star It