DEV Community

Discussion on: React PropTypes vs Typescript! Any experience?

Collapse
 
joemaffei profile image
Joe Maffei

Why are they using both? What is the purpose of the *.d.ts files?

Because even though the project doesn't use Typescript directly, someone using their library/framework might be developing in Typescript. If the library doesn't have .d.ts files, those developers would have to build type definitions themselves. That's not something you want to do when you just want to import a component into your project (trust me, I've been there.)