r/learnjavascript • u/SRc_krjasd0123 • 6d ago
React or Typescript
I just finished learning JavaScript's fundamentals at some point , and I wanted to ask: which should I learn next, React or TypeScript
6
u/DevKevStev 5d ago
Nobody finishes learning JavaScript.
One continually masters it.
You probably just finished a walkthrough made by someone else.
2
u/SRc_krjasd0123 5d ago
What i meant was that i "finished" the fundamentals and see no point in sticking to only javascript .
1
u/DevKevStev 4d ago
Oh, really? Alrighty then.
Next to do is apply what you learned in fundamentals and create like a Todo app, or an interactive e-commerce type website. Use pure HTML,CSS and JS.Only then you can proceed to React, Node JS, then Typescript
1
35
u/Chaoslordi 6d ago
Do React with typescript
4
-9
u/azhder 6d ago
No. Shouldn’t bite more than can chew
1
u/fckueve_ 5d ago
React with typescript is maybe a small to medium bite. You can do basic typescript in 30 minutes, and then react with typescript.
Currently I'm learning java and springBoot at the same time, by making an backend application, and it goes quite well.
1
u/azhder 5d ago
For you. I had to literally remove TypeScript because a colleague that has changed careers, thus knowing JS for a year, couldn’t handle working with TS + React.
I did that before leaving the company so that they can continue supporting and upgrading the software with that one person that was available. And that person was on said project for a better half of a year.
OP here writes “I just finished learning JavaScript”. How finished do you think they are?
0
u/fckueve_ 5d ago
I mean... Typescript makes coding easier, not harder.... Strict types help a lot
1
u/azhder 5d ago
No, it doesn’t. “Makes coding easier” has asterisks. You are repeating a PR talking point without understanding what you are exchanging.
In doubt, always remember “TypeScript is for tools”. Now, you can define “tool” different ways, but for this argument, let’s say it’s a software. Software will have easier time, because you like autocomplete, right? The tool will give you a nice list to pick from etc.
How about doing all that type algebra in your head? That’s a requirement for you to work in TypeScript that isn’t in JavaScript. Dealing with generics? Inheritance? Unions of types?
That is a whole new language grafted on top of JS that the tool used and some tool in some company decided is more important than you thinking about the customer’s issues - instead you are thinking of the compiler’s issues.
Writing tests works in both JS and TS, but that is another discussion.
Some people, like you, haven’t been in the shoes of that person I described to you. Many others have. You should not override their experience and knowledge with yours.
I know what you mean. Do you know what I mean?
0
u/fckueve_ 5d ago
It's not whole new language, it's just few keywords, you use most. They are extremely simple to understand. And it's not only about autocomplete. You can catch a lot od type errors with typescript, you have better classes, go to definition works way better. I can instantly check what params function accept and more. I have been working with typescript for the past 9 years and going back to vanilla is just masochism.
It may be simple for me, because I started with C++ as my first language, but those typescript types, make coding way easier. I don't care what is your definition of tool. Typescript for me is a language, saving me from touching vanilla JS
1
u/azhder 5d ago
"It's just few keywords"... you read my penultimate paragraph and decided to go against it.
I will not bother reading beyond your first sentence. There is no need. You either don't understand me or don't acknowledge that you understand me, wast of time to continue after that.
You should not override other people's experience and knowledge with yours.
What is "just a few keywords" for you, is something a lot different for others. If you are working front end, I do hope you aren't this bad understanding how software appears to other people, for everyone's sake.
Bye.
1
u/roundabout-design 5d ago
It's like asking "I want to build houses, should I learn nails or wood next?"
1
1
3
u/david_fire_vollie 5d ago
Before you learn either, please read https://github.com/getify/You-Dont-Know-JS.
2
u/No-Humor-3808 5d ago
TypeScript is a must-have if you want to write quality React code. Besides, hardly any companies build React applications without TypeScript nowadays. Take a look at TypeScript-first React practice at ReactChallenges.com
4
u/properwaffles 6d ago edited 5d ago
Understanding TypeScript is kinda key to being successful with React 😬
Edit: Well, it was for me. Ya'll do you.
4
u/8dot30662386292pow2 5d ago
Most of my websites are vanilla js + React. I've recently done Typescript though, but it is in no way a prerequisite for react.
1
u/fckueve_ 5d ago
No, it is not, but from my experience, I don't see a point to use vanilla JavaScript. Everything works well with typescript now, and coding with vanilla JS, is just pain in the ass and knees. Not only you will produce more bugs, LSP works like shit in vanilla JS
3
u/SlimmySlabby 6d ago
TypeScript is basically JavaScript with some stricter syntax so it should be very easy and quick to pickup. Then you can learn React afterwards which will take a good amount of time.
2
u/azhder 6d ago
Since they can pick up TypeScript at any time, they should start with React first, do it in JavaScript, not get confused with extra stuff because of TypeScript.
Once they know React, they can more easily notice the added static type stuff that isn’t because of React, but TypeScript.
1
u/raks1991 2d ago
Vite lets you mix
.jsxand.tsx, so you can try types on one component without converting the whole app. Just remember Vite transpiles rather than type-checks. You'd runtsc --noEmitseparately to catch type errors.1
u/azhder 2d ago
That’s even more complex.
Not only that now it will be mixing and matching two different languages… or is it more than two? For a newcomer that learns, now they also have to worry about transpilation that doesn’t check static types, so it has to run that separately.
All I advocated above is to take things step by step, instead of many similar but not same, all at once.
2
2
u/ExtraTNT 5d ago
React is a perfect framework to learn typescript with and type script helps with react…
Now, typical js evolution is: js -> ts -> js
And vanilla js -> react -> vanilla js…
1
u/buna_cefaci 5d ago
Is it worth it anymore ? To learn react and typescrip and such
1
u/Discordbothost 5d ago
yeah, for the job market they're still the most common combo in frontend postings by a wide margin. the part that's changed is that knowing the syntax is cheap now, what gets you hired is being able to debug a react app when state does something weird, and that only comes from building stuff. so it's worth it if you learn it by making a couple of real things, less so if it's tutorial after tutorial
1
u/Discordbothost 5d ago
react first, in plain js. typescript is way easier to pick up once you have a real project you can add types to, and you'll actually see what it saves you from. learning both at once mostly means fighting type errors about props when you don't understand props yet
1
u/Enough-Task6507 5d ago
You should consider an online course that teaches you React with TypeScript. That way you learn both at the same time
1
1
1
u/VancouverVentilator 4d ago
React and typescript is an unholy union. Learn it but make sure you're comfortable with typescript first because you're going to have to get eye fucked by some paragraph long type prologues
1
1
u/BobJutsu 6d ago
Typescript. TS is portable, react is implementation. I’m glad I know it, but I barely use react. But I use TS everywhere, regardless of implementation (vanilla, svelte, proprietary, etc)
1
u/randomuuid- 5d ago
Depends on what your goals are! Typescript experience will always be useful. React experience is mostly only useful when building applications that use react libraries.
0
12
u/Available_Safe1818 5d ago
How do you know that you finished learning Javascript? You studied it for 2 weeks and now you're a master of it?