react-router-dom's Link component equivalent for react-router-redux
npm install react-router-redux-dom-linkreact-router-dom'sLink
component equivalent for react-router-redux.
- Install
- Usage
- API
- Contribute
- License
If you haven't already please setup your store and router like it is suggested in thereact-router-redux README
```
yarn add react-router-redux-dom-link
or
``
npm i --save react-router-redux-dom-link
`jsx
import Link from 'react-router-redux-dom-link';
export default const AboutLinkComponent () => (
Your a-tag content
);
`
properties along with specific Link properties as well.* replace
Type:
boolean
Default: false
Description: Whether to push or replace the url provided to to in the
browser history.
Example:
`jsx
import Link from 'react-router-redux-dom-link' export default const AboutLinkComponent () => (
This link replaces the current URL
)
`* to
Type:
string
Description: The destination path of the Link. If handled by component the
component code this path gets pushed/replaced into the browser
history. If handled by the browser this path will be handled
like if you had provided it to the href attribute. Example:
`jsx
import Link from 'react-router-redux-dom-link' export default const AboutLinkComponent () => (
Simple link
)
` or
Type:
{ hash?: string, pathname?: string, search?: string, state?: any }
Description: Object that describes the destination path. It can have following properties:
* pathname: A string representing the path to link to.
* search: A string representation of query parameters.
* hash: A hash to put in the URL, e.g. #a-hash.
* state: State to persist to the location.
Example:
`jsx
import Link from 'react-router-redux-dom-link' export default const UserLinkComponent () => (
to={{
pathname: '/users',
search: '?sort=name',
hash: '#the-hash',
state: { fromDashboard: true }
}}
>
User link
)
``PRs welcome.
MIT © Mathis Wiehl
[typescript]: http://www.typescriptlang.org/
[typescript-badge]: https://img.shields.io/badge/TypeScript-friendly-blue.svg