Skip to content

Replace enums in props with union types #48

Description

@mturley

This will be a breaking change, and it's just a code cleanliness thing, but I think it'd be better to get it in sooner rather than later. Based on a discussion with @gildub a while back where he shared this article with me: https://blog.logrocket.com/put-the-typescript-enums-and-booleans-away/

It is a pain to have to import the enums used in props for certain components rather than just be able to let IntelliSense tell yo which strings are valid. TS can prevent invalid values of string types if the valid values are provided in a union type.

We should also consider watching out for the advice against booleans for state, but I'm not sure that's as important.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions