
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
react-emoji
Advanced tools
An emoji mixin for React
0.13 and 0.14 both can be used <= 0.4.x. However test code depends on React 0.14.
npm i react-emoji
# or
bower i react-emoji # `window.ReactEmoji` is available
let App = React.createClass({
getDefaultProps() {
return {
text: "foo bar :100: :)",
};
},
mixins: [
ReactEmoji
],
render() {
return (
<div>
<span>{ this.emojify(this.props.text) }</span>
<span>{ ReactEmoji.emojify(this.props.text) }</span> // or can be used no mixin way
</div>
);
}
});
All options are optional.
Properties | Description | Default | Type |
---|---|---|---|
useEmoticon | Use emoticon or not | true | Boolean |
emojiType | twemoji or emojione are available | twemoji | String |
host | Custom host | "" | String |
path | Custom path | "" | String |
ext | asset ext. svg or png are available | svg | String |
attributes | Attributes such as className or onClick | {width: '20px', height: '20px'} | Object |
singleEmoji | Show single emoji (either of annotation or emoticon), use this option if input is limited to render single emoji, this is slightly faster | false | Boolean |
strict | Throw an error if annotation is not in dict, it's handy if emoji input is not from end user | false | Boolean |
In tandem with react-autolink.
$ npm i
$ npm start # => http://0.0.0.0:8080
$ npm test
MIT
FAQs
An emoji mixin for React
The npm package react-emoji receives a total of 1,824 weekly downloads. As such, react-emoji popularity was classified as popular.
We found that react-emoji demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.