Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flag: types of property "name" are incompatible #2956

Closed
nolawnchairs opened this issue Jun 27, 2018 · 2 comments
Closed

Flag: types of property "name" are incompatible #2956

nolawnchairs opened this issue Jun 27, 2018 · 2 comments
Labels

Comments

@nolawnchairs
Copy link

I'm using TypeScript, and I'm getting this error when trying to enter a name into the "name" property

<Flag name={ip.countryCode} />

In the definition file, the name property is a huge list of allowed strings:
name: 'ad' | 'andorra' | 'ae' | 'united arab emirates' | 'uae' .....

The proper way to do this is to export that huge list, such as "FlagNameValues"

`name: FlagNameValues'

So I can mark the field as countryCode: string | FlagNameValues

Then we would not get this error when trying to use a dynamic value (which would be 99.99999% of use cases)

Will this be fixed?

@welcome
Copy link

welcome bot commented Jun 27, 2018

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you've completed all the fields in the issue template so we can best help.

We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@layershifter layershifter changed the title Flags - types of property "name" are incompatible Flags: types of property "name" are incompatible Jun 27, 2018
@layershifter layershifter changed the title Flags: types of property "name" are incompatible Flag: types of property "name" are incompatible Jun 27, 2018
@layershifter
Copy link
Member

Exported in #2957, will be shipped with next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants