Skip to content

Type checking of props #121

@DanWebb

Description

@DanWebb

Typescript isn't checking the validity of props.

This causes issues where storybook examples can use invalid props and errors leak out into projects.

Example with the slider component

In the project we get an error for invalid props:

Screenshot 2023-04-18 at 13 29 33
Screenshot 2023-04-18 at 13 33 03

In the story no error is present:

Screenshot 2023-04-18 at 13 29 23

We can even pass a typed prop using a completely incorrect type without receiving an error:

Screenshot 2023-04-18 at 13 35 34

I've played around with the 3 tsconfigs and compared against the setup in the project but haven't been able to get to the bottom of it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions