danalloway / react-country-flag

React component for emoji/svg country flags.
https://danalloway.github.io/react-country-flag/
MIT License
255 stars 43 forks source link

Complete types from each keys #49

Closed amerllica closed 2 years ago

amerllica commented 2 years ago

Thanks for your awesome library, it would be better to export types for each key in Country object. for example iso, it is not string, it is ISO3166Alpha2. I will send a PR for this improvement.

danalloway commented 2 years ago

while this is technically correct, this library doesn't maintain a list of country codes on purpose and changing the type means that it would have to

if strictness and enforcement of valid country codes is a concern to you, then export them into your project and do the enforcement there

this library is just an React / HTML wrapper around an element and nothing more, and I don't think it should get into the Country Code / Flag business

amerllica commented 2 years ago

Wow, what a cruel answer, I just want to help this library to make it better.

cc: @danalloway

danalloway commented 2 years ago

@amerllica apologies if that came across as cruel to you, that was not my intention at all whatsoever. I actually took the time to answer you well and as detailed as I could about why I don’t think it’s a good idea. I meant no harshness by it, apologies again for that misunderstanding!

I super appreciate your desire to help and make this library better though, thank you for that!