We started doing defacto static typing for our React components by using PropTypes. This provides runtime checking for the properties we pass to components. It means that we have to monitor the Browser console during development to actual spot issues.

But if we were to switch to TypeScript, then for a similar amount of code we would get compile time checks for the properties we pass. Of course, over time we can introduce static typing to other parts of the codebase.

Even if we use it just for Component properties it seems like a win, but I wonder if anyone got other opinions?

  • Let’s do this! TypeScript FTW.
  • Let’s stay with JavaScript.

0 voters

1 Like

For those less familiar, here’s a good resource on TypeScript:

For open source projects, static typing has some unique benefits:

  1. Higher confidence in changes mean safer community PRs and faster review process.
  2. More community dev engagement cause it’s easier to get into existing code that has solid definitions and checks.
1 Like