Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/banyan/react-autolink

An autolink mixin for React
https://github.com/banyan/react-autolink

Last synced: about 2 months ago
JSON representation

An autolink mixin for React

Awesome Lists containing this project

README

        

# react-autolink

[![Circle CI](https://img.shields.io/circleci/project/banyan/react-autolink.svg?style=flat-square)](https://circleci.com/gh/banyan/react-autolink)
[![NPM](https://img.shields.io/npm/v/react-autolink.svg?style=flat-square)](https://www.npmjs.com/package/react-autolink)

>An autolink mixin for React

## Install

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

## Usage

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

mixins: [
ReactAutolink
],

render() {
return (


{ this.autolink(this.props.text) }
{ this.autolink(this.props.text, { target: "_blank", rel: "nofollow" }) }
{ ReactAutolink.autolink(this.props.text) } // or can be used no mixin way

);
}
});
```

## Tips

In tandem with [react-emoji](https://github.com/banyan/react-emoji)

## Development

### Dependency

```
$ npm i
```

### Run

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

### Test

```
$ npm test
```

## License

MIT