0.1.9 • Published 5 years ago

@shhhplus/react-router-relative-link v0.1.9

Weekly downloads
1
License
-
Repository
github
Last release
5 years ago

react-router-relative-link

Introduction

  • A wrapper around react-router's Link and NavLink that allows relative paths.

  • Supports react-router-dom 5.x.x

Install

npm install @shhhplus/react-router-relative-link --save

How to use

import { Link, NavLink } from '@shhhplus/react-router-relative-link';

const Com = props => {
  return (
    <div>
      <div>
        <Link to="..">back to parent</Link>
        <Link to="../../">back to parent's parent</Link>
        <Link to="/child">to child</Link>
        <Link to="child">to child</Link>
      </div>
      <div>
        <NavLink to="..">back to parent</NavLink>
        <NavLink to="../../">back to parent's parent</NavLink>
        <NavLink to="/child">to child</NavLink>
        <NavLink to="child">to child</NavLink>
      </div>
    </div>
  );
};
0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.0.1

6 years ago