r/learnjavascript • u/jasonleehodges • Jul 14 '21
5 Code Smells React Beginners Should Avoid
https://betterprogramming.pub/5-code-smells-react-beginners-should-avoid-480c97799162
1
Upvotes
2
r/learnjavascript • u/jasonleehodges • Jul 14 '21
2
1
u/ChucklefuckBitch Jul 15 '21
Nice points, but I feel like point 3 is largely mitigated with the use of TypeScript.
The following snippet isn't a problem at all with TypeScript:
If
statusis typed, then our compiler would tell us about it the moment there would be a problem.That actually brings me to one of the biggest JavaScript code smells in my opinion: JavaScript itself. In my humble opinion, there are very few cases where there isn't a good reason to use TypeScript over JavaScript.