ealush / emoji-picker-react

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

fix Emojistyle type #361

Closed tylim88 closed 10 months ago

tylim88 commented 12 months ago

type error image

fix: image

advise: don't use enum

ealush commented 12 months ago

Technically I am fine with this, but seems like it fails the build (yarn build).

image (It shows the error for the onEmojiClick, but I can confirm that it only happens with your change)

I don't have the time to debug this, but feel free to do any of the following:

  1. Replace the Enum in the config with the string type (keep the enum elsewhere, because it is exported, and I don't want to change the existing exposed interface)
  2. Find why it is breaking in the build step and fix it. I currently don't have the time to do it.

Either of these is fine with me, I'd personally go with 1. because, as you noted, enums aren't great.

tylim88 commented 12 months ago

this is because the TS version of tsdx is too old (tsdx uses its own TS version in its node module)

tsdx seem dead

I replaced tsdx with dts-cli (a fork of tsdx)

I fixed all EmojiStyle type errors, the runtime code remain intact