Skip to content

Conversation

@sandrina-p
Copy link
Collaborator

Follow-up of #181, comment #181 (comment).

Watch this loom explaining why enum should be typed as unknown[] instead of any[].

TLDR: Internally we use enum to map it to some places that must be string. By using any, TS doesn't throw an error saying enum is not a string, which can lead to bugs if we don't pay attention (shown in Loom).
By typing enum as unknown[], TS calls our attention to it.

@sandrina-p sandrina-p merged commit e745444 into main May 7, 2025
2 checks passed
@sandrina-p sandrina-p deleted the rmt-1606-jsf-select-enum-is-not-supported-as-options--enum-unknown branch May 7, 2025 11:18
@lukad
Copy link
Collaborator

lukad commented May 7, 2025

Late to the party, but thanks for the explanation! Overriding enum makes complete sense 👍

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.

4 participants