Today I wanted to recap using TypeScript with React. It will cover typing your props, passing in components as children or props, event handler and more. We then look into useState and your own custom hooks and ensuring these are properly typed. Next we take a look at useRef and forwardRef, must knows for creating advanced component libraries. Lastly we will look at typing React Context.
I hope you learn something new in this video, let me know in the comments what you have learnt or if you haveany tips of your own.
Discriminated Union Video: • Stop using so many optionals… Simple types...
-----
Twitter (X): / jollyshopland
Personal Site: https://jamesshopland.com
GitHub: https://github.com/jolbol1
JollyUI: https://jollycod.ing/ui
Where I Work: https://jollycod.ing/work
-----
0:00 Introduction
0:26 Typing Component Props
9:40 useState
13:50 useRef
14:53 forwardRef
15:46 React Context