Twitter's open source project, Http://twitter.github.io/twemoji, is currently the most widely used, and many other open source solutions are based on it. Project Home https://twemoji.maxcdn.com/ You can use Twemoji by adding a JS file to the script tag. The Twemoji.parse function can handle both text (converting emoji code in text to the corresponding IMG tag), You can also process the DOM (via Document.createdocumentfragment () to convert the emoji code in the existing DOM to an IMG tag and then load it onto the page via Appenchild). Problem: Twemoji operation on DOM is not suitable for react framework, and can only be executed after window.onload; The server is abroad, the image of the expression load slow, JS has put on the CDN version will be better. In the end, I chose Twemoji's scheme of handling text. After that will consider JS to make some changes, JS and emoticons put on the site server to improve the speed of requests. Add an easy-to-use tutorial https://blog.farrant.me/adding-emoji-support-to-any-website/ |