I work with React.js and I was thinking to learn React native. But I have a quick question Should I learn Typescript or should I just go with React Native?
The thing is I can do pretty much everything with Javascript that's why I am little confuse about Typescript. Does it worth giving time or should I just go to mobile development?
Top comments (6)
YES.
TypeScript is strongly typed, errors will be highlighted at build-time, not run-time, auto-docs and Intellisence is super valuable, TS has additional syntactical features that JS doesn't.
Check out this SO post for more info: stackoverflow.com/a/12694578/979052
Thanks for the post. It really helped me😊
Yes.
Also, typescript == Javascript. The only thing that typescript adds is the option to strongly type your javascript by defining types.
Because it is strongly typed, typescript will help you to catch errors in your code at build time, instead of runtime and infact if you use visual studio code. It will highlight errors for you before you even attempt to compile your code.
Its also important to note that typescript does type inferrence. Take the code snippet above for example. Typescript will automatically infer the return type of
myFunc
, you do not have to explicitly define the return type, unless you want to:Thanks man that was really helpful 😊 I guess I'll drive in Typescript then.
You should learn Typescript - it's in your benefit so long as you continue to write and maintain JavaScript projects.
I guess typescript is the way to go then.