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

chore: Support autocomplete for Row and Column gap and alignment #1424

Merged
merged 1 commit into from
Jul 19, 2024

Conversation

VincentSmedinga
Copy link
Contributor

Describe the pull request

Thank you for contributing to the project!
Please use this template to help us handle your PR smoothly.

What

To help developers select an allowed value of these props.

Why

Makes them work faster and with less errors.

How

Uses const assertions (as const) on the list of string options to force its type not to be string[] but the array of values itself.

An array has a numeric index signature, as it’s indexed by numbers (0, 1, 2, …), so we use typeof animals[number] to get a union type of all items in our array: 'cat' | 'dog' | 'mouse'.
https://steveholgado.com/typescript-types-from-arrays/

@VincentSmedinga VincentSmedinga requested a review from alimpens July 19, 2024 14:02
@VincentSmedinga VincentSmedinga changed the title Support autocomplete for Row and Column gap and alignment chore: Support autocomplete for Row and Column gap and alignment Jul 19, 2024
@alimpens alimpens merged commit 84eb512 into develop Jul 19, 2024
6 of 7 checks passed
@alimpens alimpens deleted the fix/string-literal-type-intellisense branch July 19, 2024 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants