DEV Community

Rita Bradley
Rita Bradley Subscriber

Posted on • Edited on

2 1

TypeScript or PropTypes

Of course my first post ever after being a member for 3 years will be to ask a (probably) dumb question. If you write React apps with TypeScript, is it even necessary to declare PropTypes? If so, why? If not, why not? I'm really trying to work up the courage to continue learning TypeScript but as I primarily create with React, I have a hard time seeing its usefulness. Please educate me! Much appreciated.

Top comments (3)

Collapse
 
ritabradley_dev profile image
Rita Bradley

Thank you so much for this explanation. I was aware that neither help during runtime but I never considered why they would be used if it’s not something that’ll affect runtime. I never considered that TypeScript could be beneficial to people coming from a different language. Makes perfect sense.

Collapse
 
gauravumrani profile image
Gaurav

TypeScript If you want to ship bug free code.