Cons: One more tool in your toolchain. Some code, especially libraries, can be exceptionally hard to type. Some people "overtype" and lose productivity, some people "undertype" making TypesSript less effective. Finding the right balance is mental overhead. Almost all third-party libraries have types but type quality can vary. No runtime checks, leading to false sense of correctness Longer build times, some types are very expensive to compute and type checking is not easy to debug. Pros: Anecdotal, but TypeScript has found and prevented more bugs in our codebase than any unit test suite could ever do Better intellisense, JSDoc can do some of this but TypeScript is way more powerful Some JavaScript anti patterns, e.g. god object, global state or mutability, are naturally disincentivized because they are hard to type leading to better code TypeScript can be used in CI/CD Even though I wrote more cons, the pros, especially the first one, way outweigh the cons for anything half serious. Writing TypeScript WILL make you a better programmer and it WILL improve your programs. Answer from TwiliZant on reddit.com
Top answer
1 of 44
219

Anything you care about should be written in typescript. There’s no legitimate debate here.

Pros: Catches many compile time errors, vastly reducing the number of errors a developer can make.

Improved intellisense. Better autocomplete. Devs can write code faster because VSCode is able to help them out a lot more.

Easier refactoring. For example If you decide to change some data type used throughout your application, you can instantly know each part of the application that needs to be changed because typescript will produce errors in each file.

It vastly improves maintainability.

Cons:

overhead in writing types. Although, the amount of time saved is orders of magnitude greater than the time it takes to write these types

So yeah. It’s not a debate. If you care about some piece of code you should use typescript. End of story

2 of 44
140

Cons:

  • One more tool in your toolchain.

  • Some code, especially libraries, can be exceptionally hard to type.

  • Some people "overtype" and lose productivity, some people "undertype" making TypesSript less effective. Finding the right balance is mental overhead.

  • Almost all third-party libraries have types but type quality can vary.

  • No runtime checks, leading to false sense of correctness

  • Longer build times, some types are very expensive to compute and type checking is not easy to debug.

Pros:

  • Anecdotal, but TypeScript has found and prevented more bugs in our codebase than any unit test suite could ever do

  • Better intellisense, JSDoc can do some of this but TypeScript is way more powerful

  • Some JavaScript anti patterns, e.g. god object, global state or mutability, are naturally disincentivized because they are hard to type leading to better code

  • TypeScript can be used in CI/CD

Even though I wrote more cons, the pros, especially the first one, way outweigh the cons for anything half serious. Writing TypeScript WILL make you a better programmer and it WILL improve your programs.

Top answer
1 of 3
44

React is a library/framework for building UIs. You construct various components that describe what you want the page to look like, and then react handles figuring out what changed and making updates to the page. If someone just says "react" without any other context, this is probably what they mean.

React Native uses the same core functionality as react, but once it has figured out the changes that need to be made, rather than update the dom (ie, the webpage), it updates native components for android or ios. React native thus lets you write native phone apps, using the syntax and tools that are familiar to react developers.

Javascript vs typescript is completely different axis. Javascript is the main programming language used by webpages. Typescript is a superset of javascript, which lets you add type information to your code. This then lets you find bugs in your code quicker, because your IDE and build process can check the types to see if you've made mistakes. You can write a webpage (including a react webpage) using whichever you prefer (I prefer typescript).

2 of 3
21

Before going into the difference between React JS and React TS, you have to understand how React TS projects, in fact any TS project, actually works.

TypeScript is not a language that runs natively on the web. The typings that you add to your codebase don't have any meaning on the browser. When you build your code, your TypeScript code gets transpiled to JavaScript. So if you look at the bundled code, you can't find any difference between React JS and React TS, they bundle the same JavaScript code.

With that out of the way, let's talk about React Native and React. React, on its own, is a framework to build applications declaratively with components. When people refer to React while building a web app, they often just say React but they should instead say React and React-DOM because React-DOM is the library that actually renders to the browser.

You can think of React as the foundations of the React ecosystem. React-DOM is the library that builds on React to render your applications on the web. React Native is the library that renders your application on mobile apps and even more (MacOS, Windows, Apple TV and so on are also possible compile targets for React Native). I suggest you read React Native documentation to learn more about how it does this. I've personally used the Expo Managed Workflow to develop cross-platform mobile apps.

The difference between doing React JS and React TS is the language you write. You write JavaScript or TypeScript, but at the end of the day the bundle is always JavaScript (Note: Deno is different, it natively runs TypeScript, check it out).

And the difference between writing Javascript and Typescript is only the developer experience. When you write Typescript, you get static type-checking and incredible autocompletion. I always write Typescript because it finds most mistakes I make before I get a chance to even run my code. The downside to this is that, when I use libraries that don't have typings, I have to deal with that on my own (either write typings myself or use something else).

Discussions

import * as React vs. import React

It just depends on your tsconfig file. There is an option called allowSyntheticDefaultImports. If that is set to true, you can do “import React from ‘react’”

From typescript docs:

allowSyntheticDefaultImports

Allow default imports from modules with no default export. This does not affect code emit, just typechecking.

More on reddit.com
🌐 r/typescript
24
23
April 20, 2018
Zustand React Typescript Tutorial (vs Easy Peasy)
Hey guys, I've been using easy peasy for years now as an alternative to REDUX and I love it! I'd like to make a comparison of this library with zustand (another state management library based on hooks) that I have used recently and that is more popular. I personally prefer easy peasy, in this video I explain why! More on reddit.com
🌐 r/reactjs
1
4
May 26, 2021
I made a couple of TypeScript React VS Code Snippets.. are they best practice?

I prefer to set the state directly on the class as a property - in the transpiled code, this happens after the super(props) call, so you can still use this.props if you need something off of it for initial state.

This makes the constructor totally unnecessary in most cases, unless you need to do other stuff e.g. function binding.

More on reddit.com
🌐 r/typescript
17
9
July 15, 2018
React using TypeScript vs using JavaScript?

Cons:

  • One more tool in your toolchain.

  • Some code, especially libraries, can be exceptionally hard to type.

  • Some people "overtype" and lose productivity, some people "undertype" making TypesSript less effective. Finding the right balance is mental overhead.

  • Almost all third-party libraries have types but type quality can vary.

  • No runtime checks, leading to false sense of correctness

  • Longer build times, some types are very expensive to compute and type checking is not easy to debug.

Pros:

  • Anecdotal, but TypeScript has found and prevented more bugs in our codebase than any unit test suite could ever do

  • Better intellisense, JSDoc can do some of this but TypeScript is way more powerful

  • Some JavaScript anti patterns, e.g. god object, global state or mutability, are naturally disincentivized because they are hard to type leading to better code

  • TypeScript can be used in CI/CD

Even though I wrote more cons, the pros, especially the first one, way outweigh the cons for anything half serious. Writing TypeScript WILL make you a better programmer and it WILL improve your programs.

More on reddit.com
🌐 r/reactjs
95
62
November 30, 2020
🌐
Netguru
netguru.com › home page › blog › typescript vs react: which technology is right for you?
TypeScript vs React: Which Technology is Right for You?
June 30, 2025 - The typescript compiler transforms your typed code into plain JavaScript that runs in any environment supporting JavaScript. React focuses exclusively on user interface construction and state management.
🌐
DEV Community
dev.to › shahharsh › javascript-vs-typescript-for-react-making-the-right-choice-for-your-project-1ab2
JavaScript vs. TypeScript for React: Making the Right Choice for Your Project 🤔 - DEV Community
August 26, 2024 - Both JavaScript and TypeScript offer unique benefits for React development. JavaScript provides flexibility and familiarity, while TypeScript offers type safety and improved tooling.
🌐
React
react.dev › learn › typescript
Using TypeScript – React
TypeScript is a popular way to add type definitions to JavaScript codebases. Out of the box, TypeScript supports JSX and you can get full React Web support by adding @types/react and @types/react-dom to your project.
🌐
Simplilearn
simplilearn.com › home › resources › software development › learn react tutorial with real-world projects › guide to using typescript with react
Guide To Using Typescript With React | Simplilearn
April 13, 2025 - Learn how to use TypeScript in React projects. Also know why TypeScript is useful in React, as well as how to install TypeScript with Reactand set up it. Read Now!
Find elsewhere
🌐
Pulsion Technology
pulsion.co.uk › home › mobile app development › react with typescript vs. react with javascript: which is better?
React With TypeScript vs. React With JavaScript: Which Is Better? - Pulsion Technology
September 17, 2025 - TypeScript was more readable due to type annotations and improved type safety among other things. React and TypeScript work for mobile and web development and include static typing and early build process error checking to reduce maintenance later.
🌐
CodeParrot
codeparrot.ai › blogs › react-typescript-vs-javascript-when-to-use-which
React TypeScript vs JavaScript - When to use which one (With Comprehensive Code Examples)
August 2, 2024 - TypeScript offers stronger typing and better tooling support, which can lead to more maintainable and error-free code, particularly in larger projects. On the other hand, JavaScript's simplicity and lower barrier to entry make it an ideal choice ...
🌐
Graphite
graphite.com › guides › react-vs-next-vs-typescript
React vs. Next.js vs. TypeScript
Next.js is a framework for building full-fledged web applications, using React for UI development. TypeScript is a superset of JavaScript that introduces type safety and helps developers build more robust and maintainable web applications.
🌐
Quora
gwlmeilpnclidfvj.quora.com › Why-is-React-preferred-over-TypeScript-if-TypeScript-does-the-same-things-but-it-is-more-portable-It-also-works-with-No
Why is React preferred over TypeScript if TypeScript does the same things but it is more portable? It also works with Node to manage components and it is reactive as well. - TypeScript Language - Quora
Answer (1 of 3): I don't understand anything about this question. TypeScript is a superset of JavaScript and doesn’t really have anything to do with React. They don't “do the same thing”, they are totally different things. You can use React with plain JavaScript or with TypeScript.
🌐
Quora
quora.com › Why-is-TypeScript-not-as-commonly-used-with-React-as-it-is-with-Angular
Why is TypeScript not as commonly used with React as it is with Angular? - Quora
Answer (1 of 3): I don’t think that’s factually true, however - Angular made the decision a few years ago to write its docs with TypeScript. Many people assume that TypeScript is required to use Angular, when you really need anything that can compile to JavaScript.
🌐
The New Stack
thenewstack.io › home › typescript vs. react.js
Typescript vs React | The New Stack
February 4, 2023 - TypeScript supports enterprise-wide development. ReactJS and React Native support user interfaces for web and mobile applications.
🌐
freeCodeCamp
freecodecamp.org › news › use-typescript-with-react
How to Use TypeScript with React
November 15, 2023 - Now, with this change, the TypeScript error will be gone as you can see below: ... This is how we specify what props a particular component accepts. ... We can also declare the props type using type keyword. So open the App.tsx file and change the below code: import { FC } from 'react'; interface AppProps { title: string; } const App: FC<AppProps> = () => { return <div>App</div>; }; export default App;
🌐
TypeScript
typescriptlang.org › docs › handbook › react.html
TypeScript: Documentation - React
TypeScript supports JSX and can correctly model the patterns used in React codebases like useState.
🌐
Medium
medium.com › womenintechnology › mastering-react-with-typescript-its-benefits-and-importance-85cbc783a85a
Mastering React with Typescript: It’s Benefits and Importance | by Karnika Gupta | Women in Technology | Medium
October 4, 2023 - React with Typescript is a powerful combination for creating web applications. Typescript helps in giving static type in the react project which helps the developers in maintaining code quality and improves productivity.
🌐
AppsDevPro
appsdevpro.com › home › react with typescript vs javascript: which is better in 2024?
React With TypeScript Vs JavaScript: Which is Better?
March 18, 2024 - TypeScript also supports a number of powerful features that make it easier to work with large projects: modules, interfaces, generics, type inference and more! ... In a nutshell, as the competition in web development becomes more challenging, developers are always looking for the latest and greatest tools to improve their productivity and create even better applications faster than ever before. This includes choosing between React with JavaScript vs Typescript.
🌐
LinkedIn
linkedin.com › pulse › exploring-differences-between-reactjs-typescript-thosyn-pax-gytie
Exploring the Differences Between React.js and TypeScript
February 13, 2024 - In the TypeScript example, we explicitly define the type of the name prop using an interface, ensuring that only values of the type string can be passed. React.js relies on dynamic typing, allowing variables to change types during runtime.
🌐
TkDodo
tkdodo.eu › blog › react-query-and-type-script
React Query and TypeScript | TkDodo's blog
May 16, 2021 - Let's start by not passing in any Generics at all and let TypeScript figure out what to do. For this to work, we need the queryFn to have a good return type. Of course, if you inline that function without an explicit return type, you will have any - because that's what axios or fetch give you: ... If you (like me) like to keep your api layer separated from your queries, you'll need to add type definitions anyways to avoid implicit any, so React Query can infer the rest:
🌐
TIS
tisdigitech.com › home › development › typescript vs. react: why choose one over the other?
Typescript vs React: Which to Choose For Your Project?
January 17, 2023 - Typescript is a statically-typed programming language requiring the programmer to declare the data type they are using before they can start coding. This means that the codebase is more predictable and easier to debug.
🌐
Capicua
capicua.com › blog › react-typescript-javascript
TypeScript vs JavaScript on React
June 24, 2024 - Experienced Developers are confident about writing complex React's Component-Based Architecture with IDE support, knowing their code is less likely to have errors at runtime. If you're not used to strict languages like C# or Java, TypeScript will make writing React.js custom UI components more difficult.