Video wird geladen...
Video konnte nicht geladen werden
⚛️ How to use TypeScript type predicates in React to create a more robust, type-safe, and maintainable component. (this pattern is particularly useful when dealing with discriminated unions or when you need to narrow types based on runtime checks)
29,524 Aufrufe • vor 1 Jahr •via X (Twitter)
5 Kommentare

George Mollervor 1 Jahr
I've been working professionally with React for more than 8 years and I compiled all my knowledge into 100+ infographics and 70+ video tutorials just like this one. Check them out ↓

Andre de Waardvor 1 Jahr
We don’t need this since TS 5.5 right?

Prasenjitvor 1 Jahr
Thank you for the check, it's going to be useful.

Pavel Romanovvor 1 Jahr
Strange, I've just tested it in TS playground and stackblitz React playground and it narrows the type correctly (with the latest TS version). Maybe it is a problem of some older TS version or less strict TS complier config?

Davide Brianovor 1 Jahr
This is automatically narrowed with the latest TS version now 👌🏻
Ähnliche Videos
1:10
Sensitive content
🚨 Pokimane Asked Nina Lin What Is Her "type" Of Men - Pokimane Kept Nodding And Agreed With Her 💀💀 '' My type is the obeying type. I need obeying. I need you to listen. Not too much talking. Shut up when you need to. Mind your own business. Make sure my business is running good. If I need assistance in anything, you have to drop everything and help me. Your wallet is my wallet. My wallet is my wallet. ''
Nolimitzor
640,714 Aufrufe • vor 8 Monaten
