Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

⚛️ React + Typescript tip: Creating dynamic prop types for components with Discriminated Unions ↓

77,657 görüntüleme • 2 yıl önce •via X (Twitter)

12 Yorum

George Moller profil fotoğrafı
George Moller2 yıl önce

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 ↓

Pavel Romanov profil fotoğrafı
Pavel Romanov2 yıl önce

One of the best react + typescript tips. It makes the overall code flow so much easier and enforce specific rules whenever needed.

George Moller profil fotoğrafı
George Moller2 yıl önce

I agree, this is such a common use case for React developers! it's great to have a way to type it.

Web-Dev-Codi profil fotoğrafı
Web-Dev-Codi2 yıl önce

Typescript version ohhhh yeah. Nice 👍

George Moller profil fotoğrafı
George Moller2 yıl önce

oh yeah, typescript + react tips are coming my friend!

Shripal Soni profil fotoğrafı
Shripal Soni2 yıl önce

Loved this tip 🤩

George Moller profil fotoğrafı
George Moller2 yıl önce

Glad you liked it Shripal!

NORMAL profil fotoğrafı
NORMAL2 yıl önce

Where’s the discrimination here ? Dang libs 🇺🇸 🍺

freddie profil fotoğrafı
freddie2 yıl önce

a good idea is to keep all members of the union with the same keys, but set the ones that aren’t supposed to be there as *optional never*. this will help you when writing the body of the component without needing to check for the existence of properties

P4R4NO1D73 profil fotoğrafı
P4R4NO1D732 yıl önce

what tool do you use for animation ?

satonin profil fotoğrafı
satonin2 yıl önce

Wtf 🥴

Parth Prajapati profil fotoğrafı
Parth Prajapati2 yıl önce

A super tip! Really cannot imagine working in React + TS without this.

Benzer Videolar