1.2.8 • Published 5 years ago

react-router-innerhtml-links v1.2.8

Weekly downloads
103
License
MIT
Repository
bitbucket
Last release
5 years ago

React Router innerHTML Links

Used to let innerHTML links be handled the react-router way. For example links created in WordPress' wysiwyg editor.

Installation

Using NPM:

npm install react-router-innerhtml-links --save

Using Yarn:

yarn add react-router-innerhtml-links

How to use

Import

Import the class in the component that needs it.

import Links from 'react-router-innerhtml-links';

Mount

Run it on mount. Bind it to the component so that you can run it on Unmount again to remove listeners.

Accepts two parameters

componentDidMount() {
  this.links = new Links(this.div, storeHistory);
}

Unmount

Remove event listeners.

componentWillUnmount() {
  this.links.removeListeners();
}

Exclude

You can exclude links in elements by adding a data-nolinks attribute to the parent.

<div data-nolinks>
  <a href="#">Excluded link</a>
</div>
1.2.8

5 years ago

1.2.7

7 years ago

1.2.6

7 years ago

1.2.5

7 years ago

1.2.4

7 years ago

1.2.3

7 years ago

1.2.2

7 years ago

1.1.0

7 years ago

1.0.0

8 years ago

0.0.1

8 years ago