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

Force use of enums

Open baileys-li opened this issue 11 months ago • 2 comments

It's a little annoying that the library forces me to use enгms in string props.

image

I think better way is change them to Union string type. Example

type  Theme =  "dark" | "light" | "auto"

This way is more preferred in the community, for example it is advised by Matt Pocock.

Also current way not only force pushing using enum in such context, but force push enum code style. Library's enums styled like UperCamelCase in name and SCREAMING_CASE for keys. It's not suitable for every project. Even Typescript Documentation use UperCamelCase for name and case

baileys-li avatar Jan 10 '25 16:01 baileys-li

Hi there,

I agree that using enums for string props was not the best choice. Would you like to submit a PR to update the API to support both enum and union string types for backward compatibility?

Thanks, Evyatar

ealush avatar Jan 10 '25 18:01 ealush

Hi, @ealush! Yeah, I'll do it later

baileys-li avatar Jan 10 '25 22:01 baileys-li