I'm working on 2 similar React component libraries
I'm working on 2 similar React component libraries.
One is written in #javascript.
One is written in #typescript.
In the JS version, I frequently find edge cases that TS would have caught.
In the TS version, I move faster because I can lean on TypeScript's compiler.
Someone asked for specifics. Here’s 5 issues that TS caught:
1. A switch that wasn’t checking for all cases
2. A function that wasn’t checking for null
3. An undocumented prop
4. A invalid default prop (no corresponding prop)
5. A function not being passed the final argument