React with typescript
- With static type checking, you get to learn about potential bugs as you are typing the code, then heading to the browser and figuring it out at runtime.
- It also provides a way to describe the shape of an object, hence providing better documentation and autocomplete.
- Typescript even makes maintenance and refactoring of large code bases much easier.
As you can see there are some pretty good points to help you make the decision of adopting typescript in your code.
Now you might be thinking, I have also heard people say that typescript is just frustrating most of the time. I have to write a lot more code than I usually do and the compiler keeps complaining. I don’t know what to do about those errors. It doesn’t seem to be productive for me. Again I had the same mindset but I have to look at typescript as an initial investment that pays off in the long run. Once you get the hang of it, you will realize that the benefit you get outweighs the additional time spend on it.