Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/banyan/react-autolink
- Owner: banyan
- License: mit
- Created: 2015-03-19T03:36:42.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-09-23T15:50:44.000Z (about 8 years ago)
- Last Synced: 2024-10-19T11:16:53.270Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 342 KB
- Stars: 41
- Watchers: 2
- Forks: 9
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-react-components-all - react-autolink - An autolink mixin for React. (Uncategorized / Uncategorized)
- awesome-list - react-autolink - An autolink mixin for React. (Demos / Miscellaneous)
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