DEV Community

Cover image for Typescript to Know for React

Typescript to Know for React

Ndeye Fatou Diop on April 16, 2025

πŸ“š Download my FREE 101 React Tips And Tricks Book for a head start. Two weeks ago, I stumbled upon this post on Reddit: Should I learn React w...
Collapse
 
nevodavid profile image
Nevo David

But I like it, learning TypeScript for React feels like adding training wheels when riding a new bikemakes the trip smoother and you fall less; but what happens if you never take the training wheels off?

Collapse
 
_ndeyefatoudiop profile image
Ndeye Fatou Diop

I really like the analogy!
The nice thing here is that you never have to take the wheels off (except maybe in interviews and I agree it is painful in that case πŸ˜…)

Collapse
 
gnrlbzik profile image
Alesei N

I will be honest, I like the idea of this article a lot.

But maybe improve first example for "Benefit #1: Catch bugs before they reach production" that if statement in typescript snippet could of been as easily used in javascript example with out typescript reference... Nothing about this screams typescript specific... change, so maybe reword it so it is obvious, that this IF statement was added after typescript suggested it?

Might be just me, but thats how I read it at first.

Collapse
 
_ndeyefatoudiop profile image
Ndeye Fatou Diop

Thanks a lot for the input!
So name[0] will throw in JS but in TS, you will automatically see the warning in the IDE :)
Does it make more sense?

Collapse
 
gnrlbzik profile image
Alesei N

Yeah, anything to remove magic, and assumption, especially for those who otherwise do not know better.

Collapse
 
jutionck profile image
Jution Candra Kirana

Thank you, very helpful for learning more about ts

Collapse
 
jutionck profile image
Jution Candra Kirana
Collapse
 
kader198 profile image
Abdel Kader Maguiraga

Thanks for sharing

Collapse
 
_ndeyefatoudiop profile image
Ndeye Fatou Diop

Glad you like it ❀️

Collapse
 
anmolbaranwal profile image
Anmol Baranwal

Some cool tips! You should share it on Daily (squads)... this type of tutorial based articles are always super valuable.

Collapse
 
_ndeyefatoudiop profile image
Ndeye Fatou Diop

Thanks a lot! What are daily squads?

Collapse
 
anmolbaranwal profile image
Anmol Baranwal

Check this: app.daily.dev/squads/discover

Communities on daily.dev based on interests.

Thread Thread
 
_ndeyefatoudiop profile image
Ndeye Fatou Diop

Oh thanks a lot for sharing! I do see those but I find it hard sometimes to have the right to post πŸ˜…. Do you recommend one?

Thread Thread
 
anmolbaranwal profile image
Anmol Baranwal

It totally depends on the topic but you can definitely share it in my squad. That’s where I post all of my articles on Daily.

I can’t really comment on the reach, since the algorithm changes from time to time... so try and see which squads give you better results.

Thread Thread
 
_ndeyefatoudiop profile image
Ndeye Fatou Diop

Thanks a lot for sharing these πŸ˜ƒ