emoji-picker-react icon indicating copy to clipboard operation
emoji-picker-react copied to clipboard

Export emoji data

Open 777PolarFox777 opened this issue 2 years ago • 3 comments
trafficstars

Hello! Is there a chance you could export emoji data from src/data/emojis.ts? I would like to use it to show emoji popup when typing : character.

Currently, I'm importing a json directly from the package but it leads to duplication and my bundle contains 2 copies of emoji data. That increases bundle size a lot.

Would be really nice to use the exported version so I could get rid of the duplicates)

777PolarFox777 avatar Jul 31 '23 11:07 777PolarFox777

Another solution could be removing emoji data from the index entry point) That would work as well)

777PolarFox777 avatar Jul 31 '23 11:07 777PolarFox777

Piggy backing off of this bc i was looking for something similar. If this was implemented i could implement the search myself but it would be even better for my use case if there was a way to search for an emoji to validate it's renderable. Example below.

  
const data = { unifiedEmoji: 'badTextInDb' };
const unified = emojiByUnified(data.unified) ? data.unified : '1f60a'; // Use a default 

  <Emoji
  unified={unified}
  emojiStyle={EmojiStyle.APPLE}
  size={22}
/>

Alternatively a fallback option would also be nice.

const data = { unifiedEmoji: 'badTextInDb' };

  <Emoji
  unified={unified}
  fallBackEmoji={'smile'} // Could be unified or whatever but if unified fails then render this instead
  emojiStyle={EmojiStyle.APPLE}
  size={22}
/>

Forgive me if there's an existing solution to this just started using the library.

SeanDunford avatar Sep 07 '23 21:09 SeanDunford

Hello! Is there a chance you could export emoji data from src/data/emojis.ts? I would like to use it to show emoji popup when typing : character.

Currently, I'm importing a json directly from the package but it leads to duplication and my bundle contains 2 copies of emoji data. That increases bundle size a lot.

Would be really nice to use the exported version so I could get rid of the duplicates)

Seconding this request for the exact same usecase

jeffreyclu avatar Sep 11 '23 15:09 jeffreyclu