Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Emoji not render #397

Open
chatGPTxx opened this issue Feb 20, 2024 · 4 comments
Open

Custom Emoji not render #397

chatGPTxx opened this issue Feb 20, 2024 · 4 comments

Comments

@chatGPTxx
Copy link

First thanks so much for the great component!
I'm using it in my react nextjs app, I added customEmojis in the "EmojiPicker" component. It works fine when emoji picker pops up and I can select my custom emojis.
But when I use the selected custom emoji in "Emoji" by passing the unified value, it doesn't show.
Only workaround I found is to show EmojiPicker once.
But the issue with the workaround is it will then download all emojis which slows down my app.
Could you please advise?

@chatGPTxx
Copy link
Author

The custom emojis are in my /public/emojis folder, I set the custom emoji imgUrl as '/emojis/custom.png'

@ealush
Copy link
Owner

ealush commented Feb 20, 2024

I see. Yes. This seems to be correct. I did not think of this use case. The reason is that the picker initially adds all the custom emojis to the global emojis map, otherwise, there is not much way for it to actually look it up by unified code.

In such a scenario, there might be some prep work on your end that would need to be done, such as: loadCustomEmojis(...), do it once on app load, and it should behave the same. would such a solution work for you? If so, I will work on it during the weekend.

@chatGPTxx
Copy link
Author

chatGPTxx commented Feb 21, 2024

Thanks for your quick response!
I tried to download custom emojis to client side before initializing "EmojiPicker"
I can see custom.png downloaded successfully from browser dev tool.
But somehow they still can't be recognized by "Emoji" component.

Do you have recommended way to implement loadCustomEmojis? Or I will wait for your improvement when you get time.

@chatGPTxx
Copy link
Author

Hi @ealush ,do you have plan when will you improve it? Or please kindly guide me how can I do it at my end. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants