Last active
March 24, 2025 01:14
-
-
Save chibicode/fe195d792270910226c928b69a468206 to your computer and use it in GitHub Desktop.
Revisions
-
chibicode revised this gist
Mar 1, 2019 . 1 changed file with 10 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,3 +3,13 @@ A dead simple React [Twemoji](https://github.com/twitter/twemoji) component. <img width="184" alt="" src="https://user-images.githubusercontent.com/992008/53618713-6910e880-3ba1-11e9-9ea9-82ec7a28d83a.png"> ## Requirements: `twemoji` ``` npm install --save twemoji # or yarn add twemoji ``` -
chibicode renamed this gist
Mar 1, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
chibicode renamed this gist
Mar 1, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
chibicode renamed this gist
Mar 1, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
chibicode revised this gist
Mar 1, 2019 . 2 changed files with 10 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ # Twemoji + React A dead simple React [Twemoji](https://github.com/twitter/twemoji) component. <img width="184" alt="" src="https://user-images.githubusercontent.com/992008/53618713-6910e880-3ba1-11e9-9ea9-82ec7a28d83a.png"> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,15 @@ import React, { memo } from 'react' import twemoji from 'twemoji' const Twemoji = ({ emoji }) => ( <span dangerouslySetInnerHTML={{ __html: twemoji.parse(emoji, { folder: 'svg', ext: '.svg' }) }} /> ) export default memo(Twemoji) -
chibicode revised this gist
Mar 1, 2019 . 2 changed files with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ import React from 'react' import Twemoji from './Twemoji' const Example = () => ( <p> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ # Twemoji + React with Hooks A dead simple React [Twemoji](https://github.com/twitter/twemoji) component implemented with hooks. <img width="184" alt="" src="https://user-images.githubusercontent.com/992008/53618713-6910e880-3ba1-11e9-9ea9-82ec7a28d83a.png"> -
chibicode revised this gist
Mar 1, 2019 . 2 changed files with 11 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ import React from 'react' import Twemoji from './twemoji' const Example = () => ( <p> Hello! <Twemoji emoji="👋" /> </p> ) export default Example This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,4 +3,4 @@ width: auto; height: 1em; vertical-align: -0.125em; } -
chibicode revised this gist
Mar 1, 2019 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,6 @@ .emoji { display: inline-block; width: auto; height: 1em; vertical-align: -0.125em; } -
chibicode revised this gist
Mar 1, 2019 . 2 changed files with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,3 @@ # Twemoji + React with Hooks A dead simple React [Twemoji](https://github.com/twitter/twemoji) component implemented with hooks. File renamed without changes. -
chibicode revised this gist
Mar 1, 2019 . 2 changed files with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ A dead simple React [Twemoji](https://github.com/twitter/twemoji) component implemented with hooks. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ import React, { useState, useEffect, memo } from 'react' import twemoji from 'twemoji' const Twemoji = ({ emoji }) => { @@ -14,4 +14,4 @@ const Twemoji = ({ emoji }) => { return <span dangerouslySetInnerHTML={{ __html: emojiHtml }} /> } export default memo(Twemoji) -
chibicode created this gist
Mar 1, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ .emoji { height: 1em; vertical-align: -0.125em; } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ import React, { useState, useEffect } from 'react' import twemoji from 'twemoji' const Twemoji = ({ emoji }) => { const [emojiHtml, setEmojiHtml] = useState(emoji) useEffect(() => { setEmojiHtml( twemoji.parse(emojiHtml, { folder: 'svg', ext: '.svg' }) ) }, [emoji]) return <span dangerouslySetInnerHTML={{ __html: emojiHtml }} /> } export default Twemoji