Created
August 26, 2022 16:08
-
-
Save NaokiStark/6cc7299336ef4f476801d4351e5f5dc6 to your computer and use it in GitHub Desktop.
Use of twemoji on Svelte, the easiest way
This file contains 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 characters
import twemoji from "twemoji"; // npm i twemoji | |
export const stemoji = function (node, params) { | |
twemoji.parse(node); | |
return { | |
update(params) { | |
twemoji.parse(node); | |
}, | |
}; | |
} | |
/* use: | |
<script> | |
import { stemoji } from "./twemoji.js"; | |
</script> | |
<div use:stemoji> | |
😍🥲🥳🎮😄😥 | |
</div> | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment