DEV Community

Discussion on: πŸ€·β€β™‚οΈ Chrome just changed emojis to outlines in headings? πŸ€·β€β™‚οΈ I have a fix for your site! πŸ’ͺ

Collapse
 
denniscodes profile image
Dennis Mwangi • Edited

Best practices for using Emojis in your react app
You can create an Emoji.jsx component

import React from 'react';
const Emoji = props => (
    <span
        className="emoji"
        role="img"
        aria-label={props.label ? props.label : ""}
        aria-hidden={props.label ? "false" : "true"}
        style={{ fontWeight: "100", fontFamily: "Emojione, Noto, Twemoji, Symbola"}}
    >
        {props.symbol}
    </span>
);
export default Emoji;

Enter fullscreen mode Exit fullscreen mode


``
and call it Like this on any component

``

import Emoji from '../Emoji/Emoji';

<Emoji symbol="πŸšΆπŸΏβ€β™‚οΈ" label="man" role="img"/>
Enter fullscreen mode Exit fullscreen mode


``