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

The EmojiPicker caches the old onEmojiClick method

Open weiningning opened this issue 1 year ago • 3 comments

Hello, I encountered an issue while using the EmojiPicker component: When the props onEmojiClick of the EmojiPicker component are changed, the EmojiPicker does not update and caches the old onEmojiClick method. I am expecting the EmojiPicker to use the new onEmojiClick function when the props onEmojiClick are changed.

weiningning avatar Feb 28 '24 13:02 weiningning

Hi, do you have a reproduction?

I can confirm it used to be an issue. Wondering if it came back due to a regression.

ealush avatar Feb 28 '24 18:02 ealush

I'm encountering a similar issue while using v4.9.2, and I believe it behaves quite the same as the issue https://github.com/ealush/emoji-picker-react/issues/365, the onEmojiClick function cannot access latest component state even I wrap my click handler with a callback hook

stonelens avatar Apr 30 '24 16:04 stonelens

same problem here. any update?

Diegocndd avatar Jun 04 '24 15:06 Diegocndd