0

Typesscript adds a lot for validating types.

Does it eliminate the need for using PropTypes?

Or do PropTypes still add value in some way?

Michael Durrant
  • 93,410
  • 97
  • 333
  • 497
  • 1
    https://stackoverflow.com/questions/41746028/proptypes-in-a-typescript-react-application#:~:text=Typescript%20and%20PropTypes%20serve%20different,autocomplete%20for%20function%20calls%2C%20etc. – Rinkesh Golwala Jul 10 '20 at 18:14

1 Answers1

0

Difference between them are that TS checks at compile time and PropTypes at runtime. If you want to be safer you can compile TS to PropTypes with https://github.com/milesj/babel-plugin-typescript-to-proptypes, in this case, you will have both of them but will write types only once.

Hovakimyan
  • 510
  • 3
  • 10