DEV Community

Cover image for Should I learn TypeScript Before React
Kat Holder
Kat Holder

Posted on

Should I learn TypeScript Before React

Should I learn TypeScript before react?

No. You don’t need to learn Typescript to use React.

TypeScript is intended for large-scale application development and transcompiles to JavaScript.

Since TypeScript is a superset of JavaScript, any current JavaScript programs are valid TypeScript programs as well.

Neither of these are at all connected. In reality, combining TypeScript with React can be difficult since, unlike Angular and TypeScript or Vue and TypeScript, they were not necessarily designed with each other in mind, since Facebook, and thus React's key proponents, use Flow as their primary "gradual typing" solution. However, there is a nice chunk of community interest, so it should not be impossible.

Why should you learn TypeScript?

Code that is much more predictable and simpler to debug. TypeScript provides the required safeguards for organizing the code and catching errors of all kinds before they are executed.

Static types allow some fantastic tools. Tools for improving the development experience by the code uniformity and quality, as well as saving development time. TSLint, tsserver—which is incorporated into most TS-enabled editors and awesome-typescript-loader are examples of such tools.

The opportunity to use potential features now. TypeScript is capable of automatically closing the feature gap between JavaScript versions (using transpilation). That is, you can concentrate on working with the most recent, cutting-edge features without thinking about whether your code would run on older browsers and computers.

Harmonious teamwork on a growing codebase. Via well-defined interfaces, it combines code and introduces structure.

The key reason to learn TypeScript is code completion and familiarity for Java and C# developers. All of the other touted benefits are either exaggerated or, in my opinion, outweighed by the drawbacks.

Unit tests are more effective than typing at removing errors, and they must also be written while using Typescript.

Big projects require modularity rather than typing. Typescript will make it easier to build large inheritance trees that will land you in hot water. It's a different kind of trouble than with vanilla js, but it's always trouble.

Top comments (0)