Package Exports
- react-emoji
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-emoji) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
react-emoji
An emoji mixin for React
Features
Install
npm i react-emoji
# or
bower i react-emoji # `window.ReactEmoji` is availableUsage
let App = React.createClass({
getDefaultProps() {
return {
text: "foo bar 💯 :)",
};
},
mixins: [
ReactEmoji
],
render() {
return <div>{ this.emojify(this.props.text) }</div>;
}
});API
emojify(text, options)
Default options
All options are optional.
| Properties | Default value | Type |
|---|---|---|
| useEmoticon | true | Boolean |
| emojiType | twemoji | String |
| width | 20px | String |
| height | 20px | String |
| host | "" | String |
| path | "" | String |
| ext | svg | String |
| className | img | String |
Tips
In tandem with react-autolink.
Development
Dependency
$ npm iRun
$ npm start # => http://0.0.0.0:8080Test
$ npm testLicense
MIT