Search code examples
reactjstypescriptecmascript-6ecmascript-5

Using Ecmascript 6 or Typescript to develop React applications


I have been working on Angular since 2016. Now we have project that I have to use React to develop. I did research about languages options that we can use with React and I found the following:

1- ECMAScript 6 (I use "create-react-app")

2- Typescript (I use "create-react-app --typescript") which facebook added recently.

ES6 added new features to javascript like classes and inheritance...etc. I also noted that most of the online tutorials in 2018 is using ES6 not typescript. One more thing, when we write our code using typescript then we add another step to build process. The code will be transpiled first to ES6 then compiled using Babel compiler to ES5.

My question is it a good Idea to use typescript to develop React app?


Solution

  • I am working on an app right now which is totally based on typescript, and by this far, I didn't face any issues working with typescript. TypeScript is pure object oriented with classes, interfaces hence if you won't face any problem while working with it. Using typescript we can send multiple props to another class which is a great feature. There are other advantages too while including typescript to build our application in react native.