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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ganesan CPosted Sep 22, 2021, 4:20 AM
Parth AtaraPosted Sep 21, 2021, 12:16 PM
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'));