0.2.1 • Published 8 years ago

react-autolink v0.2.1

Weekly downloads
464
License
MIT
Repository
github
Last release
8 years ago

react-autolink

Circle CI NPM

An autolink mixin for React

Install

npm i react-autolink
# or
bower i react-autolink # `window.ReactAutolink` is available

Usage

let App = React.createClass({
  getDefaultProps() {
    return {
      text: "foo bar baz http://example.org bar",
    };
  },

  mixins: [
    ReactAutolink
  ],

  render() {
    return (
      <div>
        <span>{ this.autolink(this.props.text) }</span>
        <span>{ this.autolink(this.props.text, { target: "_blank", rel: "nofollow" }) }</span>
        <span>{ ReactAutolink.autolink(this.props.text) }</span> // or can be used no mixin way
      </div>
    );
  }
});

Tips

In tandem with react-emoji

Development

Dependency

$ npm i

Run

$ npm start # => http://0.0.0.0:8080

Test

$ npm test

License

MIT

0.2.1

8 years ago

0.2.0

9 years ago

0.1.8

9 years ago

0.1.7

9 years ago

0.1.6

9 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.3

9 years ago