DEV Community

Discussion on: React PropTypes vs Typescript! Any experience?

Collapse
 
alexi_be3 profile image
Alexi Taylor 🐶

TypeScript and PropTypes serve two different purposes. TypeScript validate types at compile time while PropTypes validate types at runtime. PropTypes are important when you are testing or debugging components that work with external data, e.g. API calls.

It's possible to generate PropTypesfrom TypeScript interfaces with the babel-plugin-typescript-to-proptypes.