TypeScript Error: How to Fix Common Issues

preview_player
Показать описание
Learn common Typescript mistakes that you for sure do every day. By avoid these Typescript mistakes you improve your code, type safety and scalability.

TIMESTAMPS
0:00 Introduction
0:40 Disabling strictness
1:25 Any operator
2:24 Unknown operator
3:41 Narrowing type
4:57 Type assertion
6:20 Don't skip types
7:32 Understanding errors
8:27 Happy path
10:20 Too much optional
11:30 Union vs enum
13:36 Exclamation mark

MOST POPULAR COURSES

FOLLOW ME
Рекомендации по теме
Комментарии
Автор

Great video and some very valid points. Regarding the use of many optional properties, I somewhat agree. I think having 2-3 optional properties is manageable. However, for anything beyond that, I would recommend adding an options property to the User interface like so; options?: Partial<UserOptions>; I think this approach is cleaner.

gunman
Автор

Great tutorial! Stay the course, your videos are really helpful

advance
Автор

Great points. I have read that some projects remove typescript from there projects and advocating that you don't need it. What do you think on this matter? Is it because of the strictness of typescript or the lag of knowledge of how to use typescript?

andreistein
Автор

Excellent points, people often don't use 10% of TS power in their projects. If you don't mind, what theme and font you're using? Looks amazing

CrazySalieri
Автор

Thanks for share this video. I have a question. If is bad practice use optional in interface, can I use for example name: string | null; instead of name?: string; Is it a good practice? Thanks

sergiogordon