简体   繁体   English

如何在 React 中使用表情符号?

[英]How I can use emojis with React?

I need to know if is there an emoji library that allows using of emojis and also gets an HTML emoji decimal or hexadecimal code to use as an HTML entity like 🎯我需要知道是否有一个 emoji 库允许使用 emojis 并获取 HTML emoji 十进制或十六进制代码以用作 HTML 实体,如🎯 for 🎯 I also want to retrieve a list of emojis codes too.对于🎯,我也想检索表情符号代码列表。

I want to render at a React component.我想在 React 组件上渲染。

Could someone help me with some ideas?有人可以帮我一些想法吗?

If I get you correctly, you want to find full emoji references list.如果我没听错的话,你想找到完整的表情符号参考列表。

You can check out this emoji unicode reference from W3Schools: https://www.w3schools.com/charsets/ref_emoji.asp您可以从 W3Schools 中查看这个 emoji unicode 参考https ://www.w3schools.com/charsets/ref_emoji.asp

Just surf the list and find the emoji you need.只需浏览列表并找到您需要的表情符号。 Copy the reference ( hexadecimal or decimal ) of that emoji and paste in html tag.复制该表情符号的引用(十六进制或十进制)并粘贴到 html 标记中。 If you still didn't get how to use the emojis with references, you can read instructions at https://www.w3schools.com/html/html_emojis.asp .如果您仍然不知道如何使用带有引用的表情符号,您可以阅读https://www.w3schools.com/html/html_emojis.asp上的说明。

If it doesn't satisfy your needs , try searching for more complex methods such as emoji-picker-react (also a simple guide with details https://www.npmjs.com/package/emoji-picker-react ) or any other library with its respective documentation.如果它不能满足您的需求,请尝试搜索更复杂的方法,例如emoji-picker-react (也是一个包含详细信息的简单指南https://www.npmjs.com/package/emoji-picker-react )或任何其他库及其各自的文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM