Skip to content

Look into leaning into TypeScript more than Prop Types #816

@harsh183

Description

@harsh183

The Wiki mentions:

Although the propTypes for the React Components is not required, it will be added gradually in the future for all existing components in FrontEnd. So please start to learn about type-checking with propTypes add it to your components.

I think the libraries and js world in general have moved to a direction using typescript types more heavily and being able to use it beyond just component props sounds really useful too. Typescript checking can be gradually introduced (similar to prop types), checks on build time (vs run time on prop types). However prop types may be useful for external API data, and from what I can gather, the use cases don't overlap a 100%. It also looks like Prop Types can be inferred from typescript definitions.

Some interesting links I saw:

https://blog.logrocket.com/comparing-typescript-and-proptypes-in-react-applications/

https://stackoverflow.com/questions/41746028/proptypes-in-a-typescript-react-application

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions