Hi,

I can type emoji.if i display ?? is there intead of emoji

Hi,

I can type emoji.if i display ?? is there intead of emoji

Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Parth Atara28 reputationPosted Sep 21, 2021, 8:16 AM EDT
import React, { Component } from 'react';
import { render } from 'react-dom';
const Emoji = props => (
className="emoji"
role="img"
aria-label={props.label ? props.label : ""}
aria-hidden={props.label ? "false" : "true"}
>
{props.symbol}
)
class ReactComponent extends Component {
render() {
return (
How to use emojis in React
Copy & paste: ??
Bad - it renders but throws an ESLint error (check the console)
Unicode escape: {'\u1F411'}
Bad - it works for some emojis (e.g. {'\u2728'}) but will not render our sheep
Using
span: ??Better - but a little verbose
Component:
Best - easily reuseable with an
aria-label(above), or without:)
}
}
render( , document.getElementById('root'));
Ganesan CRank #369 · 6.8K reputationPosted Sep 22, 2021, 12:20 AM EDT