ealush / emoji-picker-react

The most popular React Emoji Picker
https://ealush.com/emoji-picker-react/
MIT License
991 stars 166 forks source link

How to determine whether an emoji has variations #389

Open wfischer42 opened 6 months ago

wfischer42 commented 6 months ago

I'm building an emoji tapback component and I want people to be able to quick-tap to react the same way someone else has already reacted. It's similar to Slack, where the user's saved default skin-tone will be applied.

The trouble is, I can't find a way to determine whether or not any given emoji has variants as an option, so there's no way to determine when the skin-tone modifier should or shouldn't be applied. The Emoji component doesn't differentiate either: if it gets passed a unified value that includes an invalid variant modifier, it shows the broken image placeholder.

Is there any way to programmatically determine whether a given unified code will still be valid if a skin-tone modifier is attached?