If you're just getting started with TypeScript in React there are so many little things that make your life confusing - hopefully this video solves it for you and you can come back and refer to this if you ever struggle in the future! If this helps, please drop a like and comment to let me know if you need me to cover anything else (or if you just wanna say hi!) ✌️
The code & more: https://nickderaj.com/youtube/typescr...
Chapters:
00:00 - Introduction
00:20 - Project Setup / Required Files
00:51 - .tsx and .ts
01:17 - Defining Component Types inline
02:15 - Extracting the Props Type
02:44 - Required & Optional Props
03:13 - Custom Components and Imports
03:30 - Interface vs Props for Public Libraries
04:00 - Objects & Arrays with Autocomplete
04:20 - Either X or Y operator
04:47 - Passing Children as a Prop
05:28 - useState and Passing State
07:55 - Passing a Function
08:56 - Passing a HTML Function (e.g. onClick, onSubmit)
09:54 - Giving Props a Default Value
10:31 - Outro