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

Update LiteralUnion type definition so it doesnt cast everything to string #1832

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mi5ha
Copy link

@mi5ha mi5ha commented Oct 30, 2024

If LiteralUnion is defined like this:

export type LiteralUnion<T extends U, U = string> = T | (U & {});

It will make these have string type:

EvaStatus
EvaSize
EvaInputSize

So information about union is lost.

This is possible fix:

export type LiteralUnion<T extends U, U = string> = T | (string & {});

Now EvaSize and other will be of proper union type, and they will also allow custom string.

This fix will also make autocomplete possible for those props.

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

Successfully merging this pull request may close these issues.

1 participant