I did not ever search about this topic before, but today, I was thinking of converting to tsx, and when I opened youtube, I found it on the top without searching😂
One of the most interesting topics i waited for, i really wanted to know what are the main section of a jsx file that is good if to be written with types and what are less important as typescript will auto deduce it. Thanks and keep going 💕.
5:50 I think, it's not a good idea to explicitly write the return-type of fetch() without proper json-schema validation. Inferring types from something like Zod after validating will ensure better type-safety.
This might be unpopular opinion and personal preference. I understand the purpose of Typescript was created. But I also understand purpose of Javascript was invented. Javascript created to help human to programming easily. Easy to read, universal, simplicity, and versatile. Because we are not a computer. So, it's not human level to make a type checking, make it looks complicated. When we put a variable, we are as a human already know which one a string, number, or boolean without unnecessary things to describe. Let computer does (low levels). It's not Javascript does. And it doesn't mean Typescript comes in to solve those issues. When other thing comes to simplifies an issue (ex: Redux to React-Query), Typescript was the opposite. Typescript just makes programming more complicated. Also makes the syntax looks ugly.
"Javascript created to help human to programming easily" something simple. Good luck to maintain a project with hundreds of different types without types. "When we put a variable, we are as a human already know which one a string, number, or boolean without unnecessary things to describe. " But sometimes you open 20 different files, trying to figure out what properties/types do you have in this complex object with 200 properties instead of simple mouse hover with TS.