Skip to content

Variant schema works but TypeScript says there's something wrong #269

Discussion options

You must be logged in to vote

This doesn't work how I thought it would. Since the type is "pref", variant assumes there's only one pref, right? So only the first pref/city pair is considered valid.

This should actually be some sort of union:

[{pref: "a", city: 1}, {pref: "a", city: 2}, [{pref: "b", city: 3} /* ... */]

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@brandonpittman
Comment options

@brandonpittman
Comment options

Answer selected by brandonpittman
@brandonpittman
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants