0.8.0 • Published 2 years ago

@routo/link v0.8.0

Weekly downloads
9
License
MIT
Repository
github
Last release
2 years ago

routo

@routo/link

npm npm bundle size coverage license

React Link component for @routo/core

Install

yarn add @routo/core @routo/react @routo/link

Usage

The Link component must have access to the router context, see @routo/react for details.

import { Link } from '@routo/link';

const Home = () => (
  <Link to="router/POST" params={{ id: '42' }}>
    Post #42
  </Link>
);

Props

NameTypeDefaultDescription
to *stringRoute ID.
paramsobject
queryParamsobject
action'push' | 'replace''push'
childrennodeThe content of the link.
classNamestringApplied to the root element.
activeClassNamestringApplied to the root element when current url opened.
componentelementType'a'The component used for the root node. Either a string to use a DOM element or a component.
onClickfunctionCalled after updating the current route.

License

MIT © Timofey Dergachev

0.8.0

2 years ago

0.7.0

3 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.0

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.2.0

5 years ago