cesarwbr / react-input-emoji

A React input with an option to pick emojis 😍 😜 😂 😛
https://cesarwbr.github.io/react-input-emoji/
MIT License
121 stars 64 forks source link

Type error with tsx file #60

Closed teddythinh closed 3 months ago

teddythinh commented 3 months ago

Hi all, I got a type error when using with tsx file.

Type error: Type '{ value: string; onChange: Dispatch<SetStateAction<string>>; cleanOnEnter: true; onEnter: (msg: string) => void; placeholder: string; shouldReturn: true; fontFamily: string; shouldConvertEmojiToImage: boolean; }' is not assignable to type 'IntrinsicAttributes & Props & RefAttributes<any>'.
  Property 'shouldConvertEmojiToImage' does not exist on type 'IntrinsicAttributes & Props & RefAttributes<any>'.

I got this error when setting the shouldConvertEmojiToImage attribute:

<InputEmoji
    value={text}
    onChange={setText}
    cleanOnEnter
    onEnter={handleOnEnter}
    placeholder="Write a message"
    shouldReturn
    fontFamily="var(--font-montserrat)"
    shouldConvertEmojiToImage={false} // <- This line get error
/>

I'm using react-input-emoji 5.6.6

teddythinh commented 3 months ago

I find the root cause. Version 5.6.6 does not support the type for shouldConvertEmojiToImage attribute. Upgraded to version >= 5.8.0