react-twemoji
A simple React wrapper for Twemoji.
It calls twemoji.parse() to convert emoji characters to Twemoji images.
Install
npm install react-twemoji
Usage
Simply use it to wrap your emotional content. Set options
prop to pass options to twemoji.parse
.
import Twemoji from 'react-twemoji';
<Twemoji options={{ className: 'twemoji' }}>
<p>😂<span>😉</span></p>
</Twemoji>
It outputs following HTML to DOM,
<div>
<p>
<img draggable="false" class="twemoji" alt="😂" src="https://twemoji.maxcdn.com/2/72x72/1f602.png">
<span>
<img draggable="false" class="twemoji" alt="😉" src="https://twemoji.maxcdn.com/2/72x72/1f609.png">
</span>
</p>
</div>
Run example
npm run example
then open http://localhost:8080/
Development
Lint
npm run lint
Test
npm run test
Build
npm run build